MProjectile

Overview

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.

General

It uses the same properties as the MDamager General Tab

Projectile Properties

Life

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 Impact

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

Radius of the project to cast a ray to find targets better.

Offsets

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.

Rotation Behavior

Follow Trajectory

The projectile will follow the Forward Direction vector as rotation. Use this for Arrows, Spears, etc

Random

The projectile will rotate randomly. Use the Torque value to rotate faster. Use this for Rocks.

Axis

The projectile will rotate around and Axis. Use the Torque value to rotate faster.

Impact Behavior

Stick on Surface

The projectile will stick on the contact surface when it hits something. Use this for arrows, spears, etc.

Destroy on Impact

The Projectile will be destroyed on impact.

Activate RigidBody

If the Projectile has a rigid body attached to it, it will activate the physic on it.

Rigidbody

Reference to the Projectile Rigidbody

Collider

Reference to the Projectile Collider

Damage

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]

Keep Values

If this option is enabled, then the default values from the Damager Component will be used.

Physics

Gravity

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.

Push Multiplier

Multiplier of the force to apply to the object the projectile impacts.

React

The Damager receiver will apply its default Animal Reaction

Custom Reaction

You can set your own custom reaction here.

Interact

If the Damage Receiver has any Interactable component it interact with it sending the InteractorID value.

InteractorID

Index to send to the Interactable

Hit Effect

This Gameobject will be enabled on impact. If it's a Prefab, it will be instantiated.

Animator Stop Time

Time the Animator will be stopped. If it's zero, stopping the animator is ignored.

Animator Speed

Value of the Animator Speed when it's stopped

Animator

If there's an Animator Controller, it will be stopped

Events

On Hit

Invoked when the projectile hits a damager

On Hit Position

Invoked when the projectile hits a damager. It returns the Hit Point of the Damager receiver

On Hit Interactable

Invoked when the Damager receiver has an Interactable attached.

On Profile Changed

Invoked when the damage profile changes

On Fire

Invoked when the projectile is fired

Last updated