Hello!
I made a prototype of a game in Flash, and I want to switch to Unity for the production version. There’s one thing I’d like to do though that I can’t figure out how to do in Unity.
In the game, the player shoots a ball from a gun, and the ball can bounce around off various obstacles, similar to Peggle. If you’ve played Peggle, then you’ve noticed that the game draws an arrow showing the path the ball will take if you were to shoot it. It’ll even show the path after it has bounced.
In Flash with Box2D it was easy to calculate the path the ball would take by simply stepping the physics sim 60 or so times in a for loop, recording the position of the ball at each step. Then I reset the objects and draw the line segments for the saved positions to show the player the path the ball would take. An AI opponent used the same look-ahead routine to figure out which shot is best by simulating all possible shots and seeing which ended in the most favorable results.
Is it possible to step the physics sim manually in Unity to accomplish the same thing?
If not, what would you recommend for this? I’d really like to avoid having to write my own physics code to calculate the path the ball would travel.
Thank you!
-Tom