- Home /
I keep getting Compound Colliders when I don't want to.
I am trying to do a project in which I have my player attack an enemy. When the player attacks a box collider appears and if the enemy triggers the collision the enemy is destroyed. However, I also have it to where if the enemy triggers a collision with the player it will play a Hurting Animation and will lose a life. I made the attack collider a child of the player so its position will directly transform with the player's position like when the player is jumping for example. When the enemies trigger the collider that is set up for attacking it gets destroyed but also damages the player even if the enemy is destroyed and is nowhere near the player. I realized this is called compound colliders and I've researched online through Unity Answers and video tutorial's to figure this out. However, the tutorials have shown people doing exactly what I have been trying to do and do not get compound colliders. I'm new to unity but I'm having a lot of trouble making the two colliders act separately instead of as a whole.
I'm not sure if i got it right, but your player has two colliders - attacking collider and body collider capable of taking damage?
$$anonymous$$abe try creating two child game objects of your main player game object. Place attacking collider in one child and place body collider in second child. Those two child game objects shouls have separate scripts. $$anonymous$$aybe this will help.