- Home /
Collision Hit Detection Hack n Slash
So i made a script that when clicked swings a weapon and in that timeframe every entity that it its deals damage to it, now is my problem that i use ontriggerenter so every time it enters it deals damage, when ik swing my dagger for example and i turn very fast when i press w, a, s, d then its possible to deal damage to everything in a circle so my question is how can i code the thing that you can only hit in front of you and not in front when you turn very fast.
Thanks in advance,
Answer by FunkyL1zard · Feb 05, 2014 at 05:13 PM
Well You can disable the Rigid Body component in the OnTriggerEnter function. That way the collider will stop working. To re-enable it you can use Invoke.
Your answer
Follow this Question
Related Questions
get angular velocity change from collision 0 Answers
Unity2D side collision detection 1 Answer
How do I increase speed after collision? 2 Answers
Grab/Release object while pressing a key 1 Answer
Collision of a constantly moving object 0 Answers