- Home /
Melee system: colliders, raycast, or other way?
What is the best way to program a melee system? Using colliders, raycast or determine hit from distance and direction, or other way?
I'm making an RPG with melee system, the main character will have a sword. The sword should be interact with physics based objects and enemies too. In case of enemies, I just want to decrease their health. If it reaches 0, the enemy is dead. Collision system sounds precise for me. But what about performance? I don't think, the maximum number of enemies will be over 8-10 per scene.
What about the other systems' advantages / disadvantages? What should I use?
Your answer
Follow this Question
Related Questions
How could I combine melee weapons and rays? 1 Answer
NullReferenceException: Object reference not set to an instance of an object Raycast...? 1 Answer
OnCollisionEnter2D is not working 0 Answers
Raycast not ignoring layer 0 Answers
Ray cast affects all colliders in scene if mouse button is not releasesd. 1 Answer