How to change gravity when hitting different actors?

poopdecksweeperpoopdecksweeper Member Posts: 180
edited January 2012 in Working with GS (Mac)
Does anyone know how to change gravity in different areas of a scene when hitting different actors?

The game is a water game and I want to change the actor to have no gravity in water, but when the actor jumps out of water then you change his gravity to bring him back in the water.

Any help?

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    youll want to use a accelerate behavior in the down direction to act as gravity

    Create a boolean called gravOff set it to false

    Have your accelerate down behavior in a rule when attribute gravOff = false

    then whenever you want to turn gravity off, change attribute gravOff to true, then change it back to false when you want it to take effect again

    So for the water example you gave you would have a rule like so:

    When actor overlaps or collides with water
    -change attribute gravOff to true
    Otherwise
    -change attribute gravOff to false
  • poopdecksweeperpoopdecksweeper Member Posts: 180
    I did that, but then I am using the control template that was included with the creator and I need to have the gravity override the controller. I don't know which attribute to mess with when dealing with the controller.
  • poopdecksweeperpoopdecksweeper Member Posts: 180
    Bump
Sign In or Register to comment.