- Home /
Collision between rigid body zombie characters.
Hello, I want to remove the collision between a couple of characters I have (zombies).
I instantiate them on the fly, and would like to make it so that they won't collide with each other.
I have been trying to get it to work with collision layers, this is my setup:
The layer on all my zombies (and all child objects) is ZombiesCollisionLayer.
The zombie is a ragdoll, which is why I think this is kind of hard, since the rigid bodies will collide with eachother I think?
Does anyone have any ideas on how to make this work?
Well the rigidbodies should have some type of collider which should have a (physics-) Layer attached to it. If i look at the screenshot you posted i can't see your ZombiesCollisionLayer. Are you sure you added the layer correctly?
Well, in the screenshot it shortens it to iesCollisionLayer because it's too long :).
If I disable the colliders attached to the limbs, when the character dies and I set the rigidbodies to is$$anonymous$$inematic = false (to achieve the ragdoll). They will fall halfway throught the ground :/.
The falling through the ground thing is obvious because there is no collider there to collide with the ground. The rigidbody just means that it reacts to physics like gravity but collision is controlled by colliders. Could you check the entire Object structure of your zombie to see if every gameobject with a collider attached to it has the layer zombieCollisionLayer selected.
They all have that layer selected, and they still collider with eachother :/... It's quite strange.
Yes that is really quite strange. I just made a test where i added 2 cubes in a scene added a rigidbody and a box collider. then i set the same layer for both of them and then went into the physics settings and disabled the collision.
Try the same with your Zombies layer. I'm guessing that this will work and the mistake is somewhere in the colliders but just to make sure.
Also would it be possible for you to insert a web player demo to the question so that i can have a look at it (you don't have to if you don't want to).
I still think that there may be a collider somewhere hidden on a gameoject you didn't expect one to be on.
Answer by Justei · May 03, 2013 at 07:22 PM
Solution to the problem: The problem appairently did not lie in the collisions, it was the navmeshagent that was messing things up!
Setting: ObstacleAvoidanceType to "None"
Did the trick! Thanks to ExTheSea for the help on figuring out that it's not the collision that was the problem! :) (And for giving me even more insight into how collisions actually work).
No problem i'm happy to have helped you. Now you should accept your answer and maybe if you want thumbs up comments that helped you ;) (you of course don't have to)
Your answer
Follow this Question
Related Questions
Problems with character controller 1 Answer
Player's hands passing through opponent while punching 0 Answers
Make characters go through each other 1 Answer
Flying collision 0 Answers
Moving a player on a rigidbody platform that can collide 2 Answers