Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: ToxicFrog on June 15, 2018, 12:08:31 PM

Title: How to re-orient gravity every frame?
Post by: ToxicFrog on June 15, 2018, 12:08:31 PM
Hey gang! I hope there's an easy solution to my problem that I am overlooking:

I'm making an AR racing game. Using Vuforia, the RaceTrack is a child of the camera (because of the way the image tracking works). The camera is the player's phone, which is constantly moving. This means that gravity is always world-space down, but the RaceTrack is constantly rotating in world space b/c it's a child of the camera.

I want to get the orientation of the RaceTrack and have the gravity orient itself so that 'GravityDown' is always relative to the RaceTrack's 'Down'. Obviously this needs to happen every frame.

Does that make sense?
Title: Re: How to re-orient gravity every frame?
Post by: verybinary on June 15, 2018, 03:40:26 PM
Are you using the gravity from rigidbody? you can take that gravity off and make your own gravity fsm,

you can constantly rotate a group of everything to put gravity in desired direction

maybe other options that ill think about later