If I add gravity to my game how do I make an actor that has no gravity

THINGTHINGTHINGTHING Member Posts: 84
edited November -1 in Working with GS (Mac)
If I add gravity to my game how do I make an actor that has no gravity

Comments

  • touchcreamtouchcream Member Posts: 63
    You have different ways to do so.
    First option,just set movable attribute to false.
    Second option, if you want your actor to move on the x axis without being sensitive to gravity, constrain the position.y. But the problem is that it won't work if you spawn your actor randomly.
    So the third option is to constrain linear velocity on the y axis to 0 (Motion->linear->y).

    Good luck ! ;)
  • StusAppsStusApps Member, PRO Posts: 1,352
    add a behaviour to your actor to accelerate upwards at the same rate as your gravity setting. So if your gravity is y 300.

    Accelerate:

    direction 90
    acceleration 300

    This will make your character as though they are not affected by the gravity at all. You can add whatever movement rules, etc you like.
  • touchcreamtouchcream Member Posts: 63
    @stusapps : I didn't thought about that, nice ! It's better than constraining linear velocity for random actor spawning.
  • StusAppsStusApps Member, PRO Posts: 1,352
    touchcream said:
    @stusapps : I didn't thought about that, nice ! It's better than constraining linear velocity for random actor spawning.

    no problem. (can't take credit though, its been mentioned a few times before).
Sign In or Register to comment.