- Home /
Help with 2D Hit Detection!
Hello, im having a hard time trying to figure out the best way to detect if something was hitted by an attack. Im doing a 2D hack'nslash game like Jotun, EITR, Crawl.
Lets imagine an Ogre is hitting the ground So, i have a few aproaches:
1- Use animaton Events to determine when an OverlapSphere is casted to detect the collision. Animation events only handle 1 param, só it will be an Index. I have an script with an array of Radius and Positions. The index will serve to cast the overlapSphere in thos arrays. So if my ogre hit 3 times in different ways, i just need to specify where the hits are.
2 - A child object with an trigger Collider. The attack animations controll the Collider movements to follow the weapon swing. If the collider hit the player, damage is done.
One of those actualy are used in my references games? Whitch one in your oppinions are the best? It is there another way to do an Hack'nSlash hit system?
Your answer
Follow this Question
Related Questions
noob colision help! 3 Answers
Collision on specific animation 1 Answer
Velocity data from OnCollisionEnter is delayed (incorrect) 3 Answers
Need help fixing 2D Top-Down controls and collisions 0 Answers