Problem is not reproducible or outdated
How do I detect single hit on single attack?
The enemy AI i have created attacks my player which uses mecanim animations but the problem is weapon of enemy is staying inside the trigger when it attacks and instead of detecting single hit player is taking 2 or 3 hits at a time. How do I fix that so my player can take only single hit on single attack?
Thanks in advance
Answer by theANMATOR2b · Nov 29, 2016 at 09:54 PM
This is a question that is better answered by a person who knows code (not me) but I know the jest of what is needed so - I'll give my advice freely hoping it will help. The weapon should only do damage upon entering the trigger. If the weapon stays in the trigger it will not do damage. So there needs to be a code snippet, when the weapons leaves the trigger area the hit detection for the weapon is reset. Then if the weapon enters the trigger area again damage will occur.
u mean detect the trigger enter but ignoring staying and exit part.. correct?
Yeah - isn't there an ontriggerenter and ontriggerexit ins$$anonymous$$d of just ontrigger?
I'm really starting to get too far away from my art knowledge here. :)