|
Hi, first of all: I'm absolutely new to Unity (v2.6.1)... I've created a plane and a sphere in Maya (for a simple pinball game I'd like to create in Unity) and exported both as one FBX file (including normals). In Unity I attached a rigidbody and a sphere collider to the sphere ("use gravity" set to true), and a mesh collider to the plane ("IsTrigger" set to false for both objects). The sphere is placed above the surface. When I hit "play" the ball falls through the plane to infinity. If I enlarge the sphere collider quite a lot (about three times the size of the sphere geometry), it still falls through the plane but keeps hanging under the plane. If I scale the sphere collider even more the sphere falls down and its collider rolls over the surface of the plane (the sphere is of course "floating" in the air - because I expect only the colliders are used for physics calculations). Any idea what's my mistake?
(comments are locked)
|
|
Fast movement and/or thin colliders are a real issue when using physics. You're right, movement is taht fast and there is no interpolate between frames, so an object can pass through another thin object (because their positions never actually collided each other) You can try to bypass with a raycast collider searching for possible colliders like in the script DontGoThroughThings here: http://www.unifycommunity.com/wiki/index.php?title=DontGoThroughThings That script can help a lot with that problem, but is no 100% fail-safe, so try to make colliders as thick as you can.
(comments are locked)
|
|
Make sure your sphere is somewhere around (1,1,1) in scale. Change the scale factor in the mesh importer if necessary. Having a mesh collider for a flat plane is perfectly fine; this is what the default Unity plane has. But the physics engine does not like small objects. For a pinball game, I would increase the physics timestep quite a bit so physics runs at least 100fps. This does of course increase the CPU power needed, but a pinball game doesn't have many moving objects so that shouldn't be an issue.
(comments are locked)
|
|
I think MeshColliders don't work for totally flat planes. Use a plane collider instead. MeshColliders work fine for planes - and there is no such thing as a PlaneCollider in Unity for that matter :)
Jan 18 '10 at 01:48 PM
jonas echterhoff ♦♦
(comments are locked)
|
|
I hope you meant by "posting the meshcollider" posting a screenshot of the Inspector view. There you go: http://www.freeimagehosting.net/uploads/df1ca0f4dc.jpg PlaneInspector Concerning the plane collider: did you mean the box collider? I've tried to use the box collider instead of the mesh collider but the sphere still falls through the plane (even if I enlarge the height of the box collider, which was originally set to 0).
(comments are locked)
|
|
Another thing I've discovered: if I place a Unity cube beneath my plane, the sphere falls through this box, if it is scaled very flat, and doesn't fall through it, if the cube is thicker (having a box collider attached to the cube).
(comments are locked)
|
1 2 next page »

Can you post the meshcollider? It's hard to answer just form your description.
related: http://answers.unity3d.com/answers/172071/view.html