Skip to content

Grenade

Description

The grenade class is an item that allows you to throw an explosive, such as fragmentation, stun and smoke grenades.

Editor Properties

Property Function
Grenade The grenade explosive prefab.
Throw Transform Reference The Transform reference used to know where the grenade will be instantiated from.
Throw Force Defines the force that the character will throw the grenade.
Delay To Instantiate Defines the delay in seconds for the character throw the grenade. (For some grenades it is necessary to remove the protection pin before throwing, use this field to adjust the necessary time for such action.)
Infinite Grenades Allow the character to use unlimited grenades.
Amount Defines the amount of syringes the character will start.
Max Amount Defines the maximum number of grenades the character can carry.

Animation Properties

Property Function
Animator The animator reference.
Pull Animation Animation of pulling the grenade pin.
Pull Sound Sound of pulling the grenade pin.
Pull Volume Defines the volume of the grenade pin pulling sound.
Throw Animation Animation of throwing the grenade.
Throw Sound The sound of throwing the grenade.
Throw Volume The volume of the grenade throwing sound.

Public Properties

Property Function
Amount The current amount of grenades the character has.
PullAndThrowLength The duration in seconds of the animations of pulling and throwing a grenade combined.
CanRefill Can the character carry more grenades?

Public Methods

Method Function
Use Uses a unit of the item and instantiates a grenade.
DisableShadowCasting Prevents the item from casting shadows.
Refill Refill the grenades.