23-08-2017, 06:38 PM
(This post was last modified: 23-08-2017, 06:43 PM by josemendez.)
(23-08-2017, 06:25 PM)felipeyounner Wrote: Hi,
I need create realistic clothes in Unity, but im having some dificulties with obi colision with mesh colliders, the cloth is ignoring my colliders and entering in my model. I tried to follow some tutorials that i found about obi cloth and it doesnt make any sense why it is ignoring my colliders. Is there any component besides the obi colider group component that i need to make the collisions work?
And how do you guys make the first example on your asset store video? The one that the cloth slides trought the model? A demo scene would be awesome.
Thanks, and sorry for my bad english
Hi there, Felipe! welcome to the forums
Make sure that:
1.- Your MeshCollider and your cloth are in separate layers. (see http://obi.virtualmethodstudio.com/tutor...sions.html). Also, if you move your cloth to a different layer after initializing it, make sure you hit the "Set particles to layer" button to move all of its particles to the same layer as the cloth object.
2.- Collision constraints are enabled in your solver.
Also, keep in mind the limitations of mesh colliders (not Obi-specific, these apply to all realtime physics engines):
- If you use the object's transform to move it around (either in the editor using translation/rotation/scale gizmos, or at runtime) this is equivalent to teleporting it from one frame to the next. This prevents continuous collision detection from working, as it needs object's velocities to prevent penetration. Translating an object does not give it any velocity, it just "teleports" it. Using rigidbodies is the correct way of doing this.
- MeshColliders aren't deformable. Many people try to apply them to a character (SkinnedMeshRenderer) hoping that this will enable them to put a shirt on their character and have it collide with the character's skin. This is just not possible (Unity doesn't update mesh collider geometry when deformed, as it would be prohibitively expensive) and even if it was, not a good idea anyway. To do character clothing, use skinned cloth meshes together with skin constraints. This is the standard way we do it in the industry.