I imported some assets and, I used some prefabs from that assets. Some of them responds when I add the component of mesh collider to it and disable the ability of going through with it. But some of the is not is not. I can still go through them. Is it a good practice to add 3d cube and disable that or, is there any other way to disable of going through it?
I remember having something like this happen to me as well.
Is it a good practice to add 3d cube and disable that or, is there any other way to disable of going through it?
If it works, it works. But personally, I just manually add a primitive collider (box, sphere, cone etc) for simple meshes and a mesh collider (https://docs.unity3d.com/Manual/class-MeshCollider.html) if I have a complex mesh.
As for the meshes not responding to collision, try checking the static checkbox. If a game object is static, it will not move. See: https://docs.unity3d.com/Manual/StaticObjects.html
\$\begingroup\$ Yeah It will work but I think that It's not kind of good adding lot of mesh colliders for the child objects of a prefab or adding primitive colliders for them. I had to cover up about 700 mesh colliders for child objects becuase of this problem. \$\endgroup\$ Mar 20, 2019 at 17:20
\$\begingroup\$ I see. Mesh colliders are more costly to solve though. Did you fix your problem though? \$\endgroup\$ Mar 22, 2019 at 7:29
\$\begingroup\$ I solve my problem up to some level by adding each mesh collider for children objects. Still I need to know how to activate the mesh collider for parent object that enables the collider to the children objects as well. \$\endgroup\$ Mar 23, 2019 at 9:33
Following from @user1026622's answer. Mesh colliders do not collide with each other, unless the
convex option is checked. This is fine for low poly models but not recommended for higher poly models.