GameMaker: Studio

GameMaker: Studio

Find, play, and make games easily
Discover, rate, and download the best player-created games made in GameMaker: Studio for free. Or try making your own and share with the community. Click here to learn more.
Kudzu Feb 28, 2013 @ 8:13pm
Physics Help: Suspension of Gravity
Hey, thanks for reading!

Basically, one of my current projects is using physics, and 90% of the time, gravity should affect all objects normally; however, there are certain times when I would like to have a physics object temporarily ignore gravity and hover in the air (yet still be able to perform physics collision detections and move in certain directions). The change should only affect this one object, and all other physics objects in the room should continue to be affected by gravitational pull.

If I am correct, an object's density should remain static, so I don't think I can just temporarily set that to 0. Is there a simple way to temporarily negate all gravitational force for an object, or is there a nifty function someone can think of that will grab the force being applied by gravity and apply an equivalent amount of force in the opposite direction?

Thanks in advance for any tips or help! I really appreciate it.