Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Applying gravity to some physic bodies, but not others

edited August 2013 in Questions Posts: 577

Hi again guys! Last time I started a discussion I wanted to know how to make a character stop "falling" when
it touches certain positions, it all went fine and dandy until I decided I could do a lot more with the box2d physics. Ex: Rope bridges, Dynamic cave-ins etc. But yet again, I've ran into a problem (surprise surprise)
It seems as if I want to give the character gravity, the terrain I want to stay put falls also. Any suggestions?

Thanks for your time.


  • Posts: 226

    May be a physics.joint can be helpful :)

  • dave1707dave1707 Mod
    edited August 2013 Posts: 10,055

    @Prynok set gravityScale to 0 on the physics.objects you don't want to fall or set their types to STATIC.

    EDIT: If you set the gravityScale to 0, they will still move because of collisions. If you don't want them to move at all, setting type to STATIC will keep them from moving.

  • Posts: 577

    Oh splendid! Thanks dave!

Sign In or Register to comment.