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)
B) Ballistics (shoot like a cannon)
Easy to use
No coding skills required. Simply add a component and you are ready to go.
Animation
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 strecht accordingly.
You will have full control. No physics will skrew up your movement. Though you can set it to instantly enable physics if a collider is hit.
Ballistics
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: Autmatically chooses the optimal angle.
[Experimental Feature] Conteracts Unitys 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!
Visual Scripting
Supports visuals scripting (formerly known as BOLT).
Lots of examples & documentation
Check out Kamgam/HitMe/Examples.
Full Source Code
I publish this asset with full source code because as a developer I know how annoying it is to not have source code access. If you like it then please remind others to purchase the plugin. Don’t just copy and paste it everywhere. Thank you
Supports Unity 2021.2+, 2022, 2023, 2024, … LTS
It may work with earlier versions too but those are not tested anymore.
Code Sample:
public class BallisticSimpleDemo3D : MonoBehaviour
{
public Transform Source;
public Transform Target;
public GameObject ProjectilePrefab;
public BallisticProjectileConfig Config;
public void Start()
{
BallisticProjectile.Spawn(ProjectilePrefab, Source, Target, Config);
}
}
Hope you like it.