- Home /
Question by
electro_unity · Feb 07, 2018 at 05:04 PM ·
collisiontriggerhit
Best method to detect sword hits
For now Im using OnTriggerEnter on enemies, with a box collider on player's animated sword. The problem is that sometimes it doesnt work correctly, so now I wonder if I should be using raycast or maybe a big box collider in front of the player an hit every enemy inside of it... Any suggestion?
Comment
Answer by KriskyD · Feb 07, 2018 at 05:34 PM
This may help you if I got your problem right.
https://docs.unity3d.com/ScriptReference/Rigidbody-collisionDetectionMode.html
This option should be added on enemies' rigidbody or player's? Because sword itself doesnt have a rigidbody.