Projectile Toolkit 3 - Targeting and Trajectory Prediction

Want to implement game mechanics based on projectile motion? Want enemy AI to use ranged weapons such as cannons, rocks or arrows to accurately hit targets? Want to have full control over jump motion of objects in games or animations without losing their physical properties? This toolkit has got you covered!


🎮 Try Online Demos

📚 View Docs


Projectile Toolkit is a physics toolkit that solves 3 key problems related to projectile motion: targeting algorithms for gravity-affected rigidbodies to hit the specified target, trajectory prediction algorithms that predict and render the trajectory of a rigidbody, and simulation of aerodynamic movement common in sports such as football, baseball, golf (draw/fade), etc.


Projectile Toolkit is extremly easy to use, and can be quickly integrated into existing projects.


🏆 Features:

- Flexible and Easy to Use, the core APIs are carefully-designed static methods and can be called directly from your scripts; high level features are carefully designed to be used with no code or with simple code.

- Super Fast, most algorithms don't even touch trigonometric functions

- Works in both 3D and 2D, (works in 2D if only your game treats y as up axis)

- Works on all build platforms

- Plenty of inspirational demos (currently 5 educational demo scenes and 1 game demo scene), great for both learning this toolkit and quick prototyping

- Supports Unity 6+

- Full source code

- Detailed documentation


🎁 Bonuses:

Useful game toolkits such as:

★ Explosion system

★ Top-down character controller



Technical details

------------------


🎯 Targeting algorithms:

- Compute the launch Velocity by any of the following:

• angle

• height

• time

• a (coefficient of the quadratic function)

• speed

- Compute the launch angles by: speed

- Compute the max range by: elevation/speed

Example Use Cases

Try Online Demos


☄️ Trajectory prediction:

- Predict the position of the projectile at a given time

- Predict the whole trajectory points

- Test if a given velocity can let a projectile to hit a given target

- Predict the flight time

- Provides both math and physics engine trajectory calculation

- Fully customizable line style

- Two template styles provided: dash, slash

Compare the 3 Methods of Trajectory Prediction


Aerodynamic Movement:

You can use this feature to simulate aerodynamic force seen in sports such as football, baseball, golf (draw/fade), etc. You can use it to simulate wind, air drag, or achieve creative weapon behaviors too.



Roadmap

----------

- Propulsion library (drone and more)

- Custom gravity direction