Overview | Videos | Documentation | Demos | Integrations | API | Support

Doc Home > Items > Melee Weapon

The MeleeWeapon component inherits from the Weapon component and allows the weapon to apply damage after playing a melee attack animation. A melee weapon can be anything that uses an object within the character’s hand to attack. The MeleeWeapon implements the IUesableItem interface and registers for the used callback so it knows when to apply the melee damage and force.

A melee attack will use a hitbox in order to determine if an object has been hit. This hitbox is a collider that is placed on the MeleeWeapon. Multiple hitbox components can be specified. If the MeleeWeapon hits a fixed object an optional recoil animation can play which will knock the character back.

While attacking the MeleeWeapon uses the OnAnimatorItemEndUse animation event to be notified that the attack is complete. As you are replacing animations ensure this event has been added to your attack animation.

During a combo the melee weapon can be interrupted if Can Interrupt Attack is enabled. The OnAnimatorItemAllowInterruption event must be added at the location when the animation can start to be interrupted.

Attack Rate
The number of melee attacks per second

Attack Layer
The layers that the melee attack can hit

Attack Hitboxes
Any other hitboxes that should be used when determining if the melee weapon hit a target

Can Interrupt Attack
Can the attack be interrupted to move onto the next attack? The OnAnimatorItemAllowInterruption event must be added to the attack animation

Attack Sound
Optionally specify a sound that should play when the weapon is attacked

Attack Sound Delay
If Attack Sound is specified, play the sound after the specified delay

Damage Event
Optionally specify an event to send to the object hit on damage

Damage Amount
The amount of damage done to the object hit

Impact Force
How much force is applied to the object hit

Default Dust
Optionally specify any dust that should appear on at the location of the object hit. This is only used if no per-object dust is setup in the ObjectManager

Default Impact Sound
Optionally specify an impact sound that should play at the point of the object hit. This is only used if no per-object dust is setup in the ObjectManager

<- Magic Item
Static Item ->