Projects are Trajectory Objects that can destroy themselves after they collide with an object or a set amount of time. They are used for objects that are fired from the Shootable Weapon component such as rockets or arrows.
A new projectile can be created by performing the following:
- Open the Object Manager and create a new object of type Projectile.
- Adjust the Projectile values to match the type of projectile. The most common values that will be adjusted are Destroy On Collision and Spawned Objects On Destruction.
- Assign the prefab to the Shootable Weapon that should fire it. This is assigned to the Projectile field under the Firing foldout:
Destroy On Collision
Should the projectile be destroyed when it colliders with another object? A rocket will want this option enabled but an arrow normally will not.
The amount of time after a collision that the object should be destroyed.
Spawned Objects On Destruction
The objects which should spawn when the object is destroyed. Each element within this array has the following options:
- Object: the object that should be spawned
- Probability: the likelihood that the object will be spawned (0 – 1). A higher value means it is more likely to be spawned.
- Random Spin: should a random spin be applied to the object after it has spawned?
The length of time that the projectile should exist before it deactivates if no collision occurs. This will prevent the object from existing forever if for example it is shot into the air and no gravity is applied to it.