Projectile ability
A projectile ability will have it's effects delayed and instead spawn a projectile on Cast that will apply all Ability effects to the target or area it hits. Can be either targeted or directional. When the ability is targeted, it can be set to require an Ability target to be cast.
There are two types of projectiles: Physics and Non-Physics.
Physics projectiles have a rigidbody and a collider, and can collide with most other colliders. You can set the ridigbody to kinematic if you dont want to add forces on collision.
These are called "Rigidbody Collider" or "Kinematic Rigidbody Collider" in Unity's Colliders overview (link below).
Non-Physics projectiles don't have a rigidbody, and their collider is set to trigger. These can only hit objects which have a rigidbody. These are called "Static Trigger collider" in Unit's Colliders Overview.
Refer to the unity documentation for Colliders overview: https://docs.unity3d.com/Manual/CollidersOverview.html
See also: General settings, Ability component settings
Additional settings
Projectile prefab
The projectile to be spawned. Note that this prefab needs to have a Projectile
script attached. See (or use) the proved examples in Prefabs/Projectiles.
Time to live
The time until a projectile despawns if it doesn't hit a target.
In flight sound
The sound to be played from the Projectiles AudioSource
when it's traveling.
On hit action
What the projectile should do when it hit's a target. Values are None, Disable, and Deactivate.
None
Only apply effects and VFS/SFX, but don't deactivate the projectile. This is useful if you want a piercing projectile that doesn't stop at impact.
Disable
Stop the projectile's movement at the point of impact and disable it's collider so it can't affect more targets.
Deactivate
Deactivates the projectiles visuals and colliders, and then the projectile completely after it played its on hit SFX.
Targeted cast aim
Where the projectile should be aimed when cast at an IAbilityTarget
by calling ability.Cast(abilityTarget)
. If you use the built-in Ability target this will resolve to bottom/center/top of the targets collider.
Directional projectile settings
These settings apply (and are only visible) if a projectile is meant to be a directional projectile that doesn't need an ability target to be cast, i.e. when requires ability target is set to off.
Distance check range
How close to the target point the projectile will deactivate and apply it's On hit effects. This should be set to a value greater than 0 to not have the projectile accidentally travel past it's target.
Spawned projectiles
This is where you set which projectiles should be spawned when the ability is cast.
Spawn time
How much delay there should be before the projectile is spawned. Can either be a constant value or a random value between two constants that's evaluated on each cast.
Movement Behaviour
This is where you add the movement behaviour the spawned projectile should have. The + button will create a new movement asset that you can configure. Note that the movement asset is currently only editable in the inspector and not in a SPAM-Window.
See also: Projectile movement behaviour