- Home /
Creating a spherical world
I would like to create a spherical shape inside blender and then use it inside Unity as a planet to walk on. Unfortunatly a mesh of such a size would not be supported by Unity's Mesh Collider. Why though? It seems like there used to be addons which seem to be gone from the market and they are either way to expensive for me. I am still curious how I would get such a mesh to collide properly. Just kind of properly. Because using the mesh collider and even using convex does not do anything at all returning an error and if it does something the shape of the collider is in no way acceptable as it is more a bounding box of the whole mesh. I wonder Why Unity has those limitations of vertices for mesh colliders though? I mean, a flat Terrain can have a lot vertices as well but a Terrain collider, which acts as a mesh collider for meshes, still works. How can I bypass this and still have such a big mesh with a proper collider? Does anybody know how to do such stuff inside of blender? And is Unity capable of such a collider created inside of blender and will it work? Greetings
From memory, the only limitations on mesh colliders and large meshes are if you are using convex collision. As long as the object is stationary (doesn't have a rigidbody, etc) mesh collider should still work. If it's a spherical shape, can you not use the sphere/capsule collider?
Hi. Unfortunatly non-convex mesh colliders don't work at all in Unity 5 without a rigidbody assigned ("Non convex mesh collider with non kinematic Rigidbody is no longer supported in Unity 5"). But if I add a rigidbody I have to make it kinematic and then collision detection is no longer working for me. I made a low poly shape of the earth with about 12 500 tris and I really have to collide properly with it and since the earth is really large (I made it half as big as real size actually, where 1 unit in Unity equals 1 metre) and thus giving it a sphere collider would be painfull as you could walk through mountains like the $$anonymous$$ount Everest and you also could not go into water.
EDIT: Very weird. I found this link from Unity that says that collision detection should work with a kinematic rigidbody collider and a rigidbody collider. https://docs.unity3d.com/$$anonymous$$anual/CollidersOverview.html That is not true for me. Since my earth is still too large for Unity somehow (even though in blender it had 12 500 faces / tris so less than 2 ^ 16 [Unity Limit till it splits into multiple meshes]) I have two meshes that have a parent. Now i have a test object that falls towards the earth by the earth's gravity. It only does this if it's not on the ground allready. $$anonymous$$y scripts work fine with a simple sphere as the earth, so with a sphere collider. That's what my system looks like:
Test Cube (Falling towards earth, though OnCollisionEnter is not firing, has Rigidbody)
Earth
Earth $$anonymous$$esh1 (Contains a non convex mesh collider and a kinematic rigidbody)
Earth $$anonymous$$esh2 (Contains the same as mesh 1)
... so there is a kinematic rigidbody (the earth meshes) colliding with a non kinematic rigidbody (the test cube). Why is OnCollisionEnter not firing then? I don't get it...
Answer by Cuttlas-U · Apr 11, 2017 at 08:35 AM
Hi; Lucky u "Sebastian Lague" just has a tutorial for this; checkout the below link :
Your answer
Follow this Question
Related Questions
Mesh Collider on a 2D mesh creating a 3D box? 0 Answers
Collision mesh data problem in Unity WebPlayer 2 Answers
Particles going through mesh collider 1 Answer
Scale collider independent of gameObject. 1 Answer
Correct position of overlapping meshes 0 Answers