🏉MProjectile
Last updated
Last updated
The projectile component allows the Animal Controller to throw projectiles using the Damaging system. It can be fired by itself, or it can be fired by a Thrower component.
When is fired by a Thrower component, use the method Prepare() to transfer all the properties from the thrower.
It uses the same properties as the MDamager General Tab
Amount of seconds the projectile will be on the air. If the projectile has not touched anything after that time has passed, it will be destroyed.
Life of the projectile AFTER impact. If the projectile is not destroyed on impact, then wait this amount of time. Set to 0 to ignore it.
Radius of the project to cast a ray to find targets better.
When the projectile is instantiated for the first time, a local position and rotation offset will be applied to it regarding the thrower. E.g. When the arrow is instantiated, the position is modified to match better its position on the bow.
The projectile will follow the Forward Direction vector as rotation. Use this for Arrows, Spears, etc
The projectile will rotate randomly. Use the Torque value to rotate faster. Use this for Rocks.
The projectile will rotate around and Axis. Use the Torque value to rotate faster.
The projectile will stick on the contact surface when it hits something. Use this for arrows, spears, etc.
The Projectile will be destroyed on impact.
If the Projectile has a rigid body attached to it, it will activate the physic on it.
Reference to the Projectile Rigidbody
Reference to the Projectile Collider
If the Projectile is thrown by a Throwable, the Stat will be set by the Throwable.
[E.g. The Arrow will get the Damage from the Bow, The bullet from the pistol]
If this option is enabled, then the default values from the Damager Component will be used.
Gravity applied to the projectile. If gravity is zero, the projectile will go straight. If the projectile is thrown from a Projectile Thrower, then it will inherit the gravity from it.
Multiplier of the force to apply to the object the projectile impacts.
The Damager receiver will apply its default Animal Reaction
You can set your own custom reaction here.
If the Damage Receiver has any Interactable component it interact with it sending the InteractorID value.
Index to send to the Interactable
This Gameobject will be enabled on impact. If it's a Prefab, it will be instantiated.
Time the Animator will be stopped. If it's zero, stopping the animator is ignored.
Value of the Animator Speed when it's stopped
If there's an Animator Controller, it will be stopped
Invoked when the projectile hits a damager
Invoked when the projectile hits a damager. It returns the Hit Point of the Damager receiver
Invoked when the Damager receiver has an Interactable attached.
Invoked when the damage profile changes
Invoked when the projectile is fired