playMaker

Author Topic: How to re-orient gravity every frame?  (Read 909 times)

ToxicFrog

  • Beta Group
  • Full Member
  • *
  • Posts: 139
How to re-orient gravity every frame?
« 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?

verybinary

  • Junior Playmaker
  • **
  • Posts: 81
    • The Museum of Digital
Re: How to re-orient gravity every frame?
« Reply #1 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