Hit Me: Ballistics, Animated Projectiles, Targeting v1.2.6

Hit Me: Ballistics, Animated Projectiles, Targeting v1.2.6
 Shoot your objects with ballistics or animate them. All with just one line of code or a Visual Scripting node.

“Hit Me” is a projectile system with two modes of movement:

A) Animation (full control)
Tell the projectile what to hit and how long it should take. And while you are at it, add some curves to make the flight path more interesting. Your target is moving? No problem. All curves will stretch accordingly. You will have full control. No physics will screw up your movement. Though you can set it to instantly enable physics if a collider is hit.

B) Ballistics (shoot like a cannon)
Shoot like a cannon. Let the projectiles be controlled by the physics engine (2D or 3D).
+ Prediction System: Let the code calculate where the target will be in the future and shoot there. It can even predict player motion (if not too chaotic).
+ Flight path visualization: Render the path (or the predicted path) with a LineRenderer.
+ Various calculation methods:
By Time: Choose how long the projectile will fly.
By Altitude: Choose how high the projectile will fly.
By Speed: Choose how fast the projectile will be.
By Angle: Choose the starting angle.
By Energy: Automatically chooses the optimal angle.

[Experimental Feature] Counteracts Unity’s physics simulation divergence. Accurate to 0.2 units at a range of 1000 units. No need to increase the fixed delta time to hit your target!

Supports Visual Scripting (formerly known as BOLT).
Lots of examples & documentation. Check out Kamgam/HitMe/Examples. The tank demo from the video is also included.
Full Source Code available.
Supports Unity 2021.2+, 2022, 2023, Unity 6, … LTS. May work with earlier versions, but those are not tested.

Note: This is not a system to spawn 100s or 1000s of projectiles at the same time. For high-volume spawns, use an optimized system (particles). There is no hard limit, but performance will degrade with more projectiles. This asset focuses on versatility.
No object pooling for projectiles is included. Memory is allocated for every new projectile (new prefab + a copy of the config). If you want pooling, you must manually spawn and reuse prefabs, then use PhysicsUtils to add start velocity to the rigidbody.

Unity 2021.2 or higher is required (LTS releases strongly recommended).
Ballistics predictions are accurate only for friction and drag-less environments until the first collision. For air resistance, wind, or bouncing, you must perform the necessary calculations yourself.

The ballistic simulation has a “compensateSimulation” flag to counteract divergence between mathematical formulas and physics simulation. However, since physics simulation is internal to Unity, it is not guaranteed to behave the same across all Unity versions. Tested in Unity 2021, 2022, and 2023. If divergence is observed even with compensation, turn off the flag and increase the physics fixed delta time in project time settings.

This is not a simulation framework. Do not expect physically accurate results. If you want to build a simulator, you must dig into the math yourself. 


Download Source 1

Hit Me: Ballistics, Animated Projectiles, Targeting v1.2.6


END
 0
Comment(No Comments)