I’m currently working on a proof of concept for a turn-based car game. Each turn, you get to decide what you’ll do over the next second or so, whether it’s accelerate, turn, etc. I’m currently “pausing” the game by subclassing MonoBehaviour and having that toggle isKinematic on my rigidbody objects, which does a good job of freezing their movement. The vehicle physics are currently using a (modified) version of the AlternateVehiclePhysics package from the Unity car tutorial.
Here are my questions:
-
I’d like to have some way of predicting the player’s location at the end of the next turn (barring collisions, etc.). In order to do this properly, I’d need to essentially run the physics for another turn, get the final location of the vehicle, then “rewind” to show the vehicle in the right position, but have an indicator of where the vehicle will be barring any changes. If you’re going straight, the indicator would show the “end of next turn” indicator as being directly ahead, but if you pick the option to turn left instead, it would need to calculate the new position to your left and show the indicator there before you accept the command and actually execute the next turn. Does anyone have any ideas for a way to do this?
-
Once basic maneuvering is handled, I’d need to start implementing more advanced maneuvers, such as bootlegger turns, powerslides, etc. Any thoughts on how to “script” these maneuvers, so they can be essentially replayed over the next turn (i.e. accelerate for 0.2 seconds, then brake + hard left for 0.5 seconds, then moderate right for 0.3 seconds to level out)?
Thanks in advance.