Ballistic Aim
Last updated
Last updated
Support us as a GitHub Sponsor 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 GitHub Sponsors ... become a sponsor today!
An easy-to-use solution for code-free management of turrets. Add this to a game object and configure the "Y" (left and right rotation) and the "X" (up and down rotation) pivot and limits and we will do the rest. You can simply call "Aim" and we will track the target if a projectile solution available.
The speed of the projectile when it is fired / shot.
The transform to be rotated when calculating the "left and right" angle to aim down.
The transform to be rotated when calculating the "up and down" angle to aim down.
The x value of this vector is the minimal angle the Y Pivot will be allowed to assume and the y value is the maximum angle the Y Pivot will be allowed to assume. use x =-180 and y = 180 to enable free movement.
The x value of this vector is the minimal angle the X Pivot will be allowed to assume and the y value is the maximum angle the X Pivot will be allowed to assume. use x = -180 and y = 180 to enable free movement.
Call this method to update and cause the tool to rotate the Y and X Pivot to aim at the indicated target.
or
You can specify a static point to aim at or indicate the current position and velocity to have the system estimate and intercept the trajectory.
If this method returns false it indicates that no valid solution could be found, this happens if the pivot limits were hit or if the object is simply out of range given the initial velocity you configured.