-2

I am making game and I am using sword as a weapon so I have created a script and detect hit by collider of sword to deal damage but I am getting problem that it is dealing damage whenever sword collide with enemy collider even if player is not in state of attacking suggest me a script for melee attack damage

jmarkmurphy
  • 11,030
  • 31
  • 59

1 Answers1

0

You should provide more code / resources for us to properly evaluate the issue. Although, I think I get what your problem is. You should disable the collider when the character is not attack. This will stop any accidental triggers happening when not in combat.

AniOptics
  • 81
  • 5