reverse gravity on contact with an actor?
stellathefella
Member Posts: 20
I'm making a platforming game and I want to have my actor have his gravity reversed on contact with another actor. Any help would be appreciated.
Comments
Instead of using gravity in your scene, use the accelerate behaviour. That way you can switch direction based on a rule (eg. colliding with another object) and create your own gravity
I have it set to accelerate in direction 270 with 900 accel and when it hits the reverse gravity actor I have it set to accelerate in direction 90 with 900 accel. I doesnt reverse the gravity on contact.
Can you say what does happen ?
nothing for some strange reason.
Can you be more specific, answers like 'nothing' to questions like 'what happens' aren't much use when attempting to resolve an issue, I'm trying to find out what does happen, 'nothing happens' could mean lots of things, it could mean the actor just continues passed the reverse gravity actor, the reverse gravity actor has no effect on it at all, nothing happens, it could mean the actor collides with the reverse gravity actor but just stops, it doesn't go into reverse, 'nothing happens', it could even mean the actor just bounces off in some arbitrary direction seemingly unaffected by the reverse gravity rule and so on . . . . Regardless of what does or doesn't happen can you say what this actually looks like on screen, are you able to describe the result of the interaction, even if it is just 'the actor just slows down over 1-2 seconds and eventually stops' or 'the actor stops suddenly' or 'the actor just continues passed the reverse gravity actor' ?
he passes through the actor as if nothing happened.
Ok, so the actor continues moving in the direction he was going in originally (before overlapping the reverse gravity actor) . . . could you post a screenshot of your rules, I think that would help track down the issue.
http://tinypic.com/view.php?pic=rr2rtk&s=8#.VTA4tiHBzRY
http://tinypic.com/view.php?pic=5zl1zr&s=8#.VTA45yHBzRY
those are the rules for the moving actor, the the gravity reversing actor.
The two accelerate behaviours need to be in the same actor.
*not the. woops.
The two accelerate behaviours need to be in the actor that is moving (not the reverse gravity actor).
They are on the same actor but he still passes through the other actor with his gravity being reversed.
@stellathefella Do you have a Collide, bounce when colliding with actor of type
Mathtap.com (Android) | Fridgemanager.com (Android) | Breakoutofspace.com (Android)
Can we see the rules you are now using ? In the first of the two screenshots above, what is the constrain behaviour doing ?
I think his actor may not be colliding with that reverse gravity portal in order to trigger it...?
Mathtap.com (Android) | Fridgemanager.com (Android) | Breakoutofspace.com (Android)
It's hard to tell but I suspect the rule that looks for collision is in the wrong actor, but it's really hard to tell without being able to peer into the various rules and behaviours to see what they are doing.
Time to practice that clairvoyance skill I left in an old RPG...
Mathtap.com (Android) | Fridgemanager.com (Android) | Breakoutofspace.com (Android)
I knew you were going to say that.
@Socks
Mathtap.com (Android) | Fridgemanager.com (Android) | Breakoutofspace.com (Android)
I think the problem is that in the first screenshot you have the accelerate behavior outside any rule, so your actor is alway accelerating down at speed 900. So if you collide with the actor that should change gravity and have your actor accelerate up at speed of 900, those two cancel each other...
I don´t think i explained this very well, but i made a very (very) quick demo for you. (attached)
Check it out and tell me if it is anything like the thing you´re trying to achieve.
EDIT: Damn... Just realized you use the windows version...
In a nutshell:
-Make a game attribute and call it something like "ChangeGravity"
-Make a rule in the actor that says
-When game.ChangeGravity is false, accelerate 270, speed 900
-Otherwise accelerate 90, at speed 900
-Make another rule that says
-When collides with actor 'ReverseGravity'
-Change Attribute 'game.ChangeGravity to true'
Mental Donkey Games
Website - Facebook - Twitter