- Home /
How can I show trajectory of a bouncing ball OnCollisionEnter/OnCollisionExit?
I have seen ways to show the trajectory of a ball/object given a direction/velocity/angle such as when launching a projectile or throwing a grenade but those methods don't seem to take into account real time physics and/or not having a known or static starting/ending point.
I have a ball object and want to display its trajectory for two bounces meaning that I want to calculate and display the path it will take from the initial collision that gives the ball motion until the point where it collides with something else twice. The initial collision is collision 1, then the ball travels on an arc and collides with something else, which gives it a potentially new trajectory and the visualized path ends at the third total collision.
I understand I will need to use a line renderer and populate the points that it uses with a loop but I don't understand how to get the correct angle/direction of the collisions in question and my line renderer points in the wrong directions.
Essentially I want to have the result of a trail renderer for two bounces be shown when an object collides with the ball.
Your answer
Follow this Question
Related Questions
Show trajectory of a bouncing ball 0 Answers
Ball bouncing up after rolling over a cliff when it should be rolling down? 0 Answers
How to make ball bounce off screen boundaries? 1 Answer
I am trying to launch a 2d object toward the mouse. 1 Answer
How could I make a bouncy object move mostly along the Z axis? 1 Answer