- Home /
2d melee combat?
I'm making an 8-directional RPG and was wondering what would be the best approach to melee combat like in the old Legend of Zelda or in Realm of the Mad God? Should a collider be instantiated in all eight directions or should a single collider be animated to attack in each direction? Thanks in advance.
Answer by aceX · Apr 19, 2014 at 08:42 PM
The way I would approach this is with however-many-directions-you-can-attack-in triggers (I'd say four is enough). When attacking check which direction you are facing and whether there's something in the corresponding trigger or not, if that something is an enemy and you're facing it (aka it's in your range), apply some force to knock it back, animate it and reduce it's HP.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
OnTriggerStay2D only detecting trigger collisions while moving 3 Answers
Distribute terrain in zones 3 Answers
Sprite Sheet animation without fancy add-ons 1 Answer
if it's you, how will you solve it ? 1 Answer