Question by
l3adw01f · Jun 09, 2016 at 04:15 PM ·
physicsrigidbody2d-platformergravity
Is it possible to change gravity for only one object?
Right now I am making a 2d platformer using 3d physics. I have this one object that flips the scenes gravity when triggered. I am currently trying to implement a 2 Player race mode. The only problem is that when one of my players hits the gravity flipping object, it flips the entire scenes gravity. Is there a way to flip gravity for only one object? Any feedback it highly accepted.
Comment
Answer by FortisVenaliter · Jun 09, 2016 at 04:25 PM
The only way I know of would be to do so manually. Disable gravity for the object in question, and add the gravity force in the correct direction every frame to the rigidbody. That ought to give you the effect you are looking for.