Ballistic Path Line Render
Last updated
Last updated
Support us as a and get instant access to all our assets, exclusive tools and assets, escalated support and issue tracking and our gratitude. These articles are made possible by our ... become a sponsor today!
An add on for Unity's Line Renderer this component can simulate the ballistic trajectory defined by its launch settings and optionally calculate collision and bounces.
This component on its own is useful for common cases such as showing the path of a grenade, arrow, thrown object like a basketball, etc.
This component is also an excellent demonstration of the feature.
The point the projectile will start at.
The effect of gravity
The velocity of the projectile
Should the simulation be ran on the OnStart event from Unity
Should the simulation be updated ever frame
If we use collision what should we collide with ... set this to none to disable collision
How far should each step test
How far should the simulation test
How many bounces should be calculated, 0 to disable bounce calculation
How much velocity should be reduced per bounce ... this is a crude simulation of Unity's "bounciness" it will not map 1 to 1 in most cases but is a fair approximation.
A list of points along the path, the distance between each point is equal to the resolution
A list of RaycastHit values for each impact point if any
Call this method to update the simulation, if you have set this Continuous Run this will be called automatically on LateUpdate.