Melee Combat - Breakdown


Melee Combat

Melee Combat in this project is implemented using the IDamagable interface, the C_Combat.cs script, and animation events. 

(IDamagable.cs)

Characters (the player and NPCs) can perform melee attacks using Physics.SphereCast() to apply damage to all colliders that are found within the cast, using the IDamagable interface.

(C_Combat.cs)

The method AttackCast() is triggered by an event invoked by an animation event on the attack animation. This is so that the timing of the cast is lined up with the swing of the animation.


(NPC_AnimEvents.cs)

Get Magisteros

Leave a comment

Log in with itch.io to leave a comment.