- Home /
Show trajectory path a ball will take based on collision
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.