- Home /
Multiple Hitbox child Objects (King of Fighters)
Hello everyone. I've been researching colliders in fighting games, and I realized that the answers are very vague, as it is an extremely small game niche. I intend to make a parent object with rigidbody2d only, and four child objects with colliders as in this image: image?
The blue colliders are for "taking damage" from any other object. Red colliders are meant to "cause" damage to any other object.
In the OnTriggerEnter2D event of the Parent object, I would like something like this:
Switch(collisor's) { case blue_collisor: Debug.Log("something hit the blue collider"); break; case red_collisor: Debug.Log("something hit the red collider"); break;
}
Your answer
Follow this Question
Related Questions
2D, Top-down melee combat - Triggers not working. 1 Answer
Detect onMouseDown() on children colliders of a rigidbody parent 2 Answers
Trigger Triggers Without Collision 1 Answer
How to use OnTriggerEnter on different gameobject to detect collision? 3 Answers
Can child game object with OnTriggerEnter function use parent game object's collider? 2 Answers