Checklist: Object or Character is falling through the floor

This has been answered a gazillion times, but I found that all possible answers are spread across several Questions… So we should have a reference-list of possible reasons.

Greetz, Ky.

Check each Object involved (FallingObjects and GroundObjects)

  • does Object have a Collider? If not,

select Object

go to the top bar

components

physics

choose appropriate collider

(if Terrain, check the last tab, the little cog-wheel)

Note: mesh-collider may cause problems

Particularly, if both FallingObject and GroundObject have mesh-collider

Particularly, if the mesh is animated

To avoid mesh-collider, you can build an aproximate shape of your mesh from several primitive colliders (in parent-, child- or sibling-GameObjects)

If you need a Mesh-collider no matter what, you can try to place additional primitive colliders where they won’t be in the way to ‘enforce’ the collisions

  • is the Object a Trigger? If so,

select Object

find its Collider-Component (if Terrain, check the last tab, the little cog-wheel)

remove the check of ‘IsTrigger’

  • is the Collider placed well?

fiddle with center, size and skin-width (start with 0.1) until the green outline aproximately fits the character

(If you get really strange values, it might be due to scale (e.g. your mesh was way too big so you downsized to .01))

  • you may try to zero out all positioning (both unity and your modeling-program)

FallingObject and GroundObject have a problem with each-other

  • FallingObject-Collider and GroundObject-Collider intersect each other

Move the Object much above the ground (have it fall from some considerable hight for test-purposes)

All of it! Not just the collider or something else that is attached to it (e.g. the Camera of a Character Controller)

Note: a poking-through [“grey capsule”?] may cause Problems even if it’s disabled

[I am not sure what that means myself, I’m sorry… the answer that posted this solution was not very specific =/ ]

Imported Objects (.obj, .fbx, .max etc.):

  • Before dragging Object into the Scene (delete if already there)

Look at the hierarchy

find the model

properties

check ‘Generate Colliders’

hit Apply

now drag to the scene

  • Are the Normals correct? You may have to

go back to your modeling-programm

hit flip/reverse Normals

  • Is the Mesh clean?

Reportedly a single 2-vertex-“triangle” caused bad collider-issues

  • Geometry is rather complex? Then you need the Mesh-Collider set to convex

Select Object,

Mesh-Collider-Component

check ‘IsConvex’

FallingObject has a Character-Controller:

  • is a Rigidbody applied? If not,

select FallingObject

Top bar

components

physics

rigidbody

  • is Gravity applied? If not,

select FallingObject

find its Rigidbody-Component

check ‘Gravity’

  • and has a MouseOrbit?

Make sure MouseOrbit never has/picks up any parent of the respective object that MouseOrbit is attached to (usually the Camera) as MouseOrbit-target or the resulting ‘dog-chases-tail’-scenario will cause falling.

GroundObject is a Terrain:

  • rumor has it, that Terrain Collider may be screwed up by using the terrain toolkit asset package to make the terrain.

  • collisionmatrix may cause trouble

go to Edit

Project Settings

Physics

collisionmatrix

Scripts

  • FallingObject has a script with ‘transform.Translate’ or 'transform.position = ’ or various other ‘funky’ scripting

This may push the Object through the collider ‘against its will’. Try to avoid it. (e.g. use ‘velocity’ or try SimpleMove)

Keep your scene clean

  • especially the mac-version seems to be a bit buggy when faced with too much superfluous crap. may somehow disable all colliders.

Debug

  • Increase physics calculations per Frame

try and catch collider penetrations (this doesn’t solve the source of the problem)

  • drop the Character and a default Cube from high up

If both fall through, investigate the floor’s properties.

If only the character does, investigate the player’s properties.

Note

  • falling occures when minimizing or alt-tabbing the editor

This is a known issue; don’t worry about it too much, it’s only in the Editor and won’t happen in the final-built game.

Please Note: I have no competence on the matter what so ever… just gathered what I found. So please point it out if you find any (severe?!) mistakes.

my sources:

After a lot of pain and headaches, I’ve got another addition for the list.

I have a lot of moving and rotating platforms (via iTween) in my project. These were static colliders (they didn’t have a rigid body attached). After lots of research, I’ve found this thread, where it’s recommended to attach a kinematic rigid body to a static collider wich is going to be moved a lot (in order to improve PhysX efficiency). So I attached kinematic rigid bodies to every moving or rotating platforms in my scene.

Worked for me!!!

HIGHLY OVERLOOKED RESOLUTION

Add this to the list

Under the component Rigidbody:

  Collision Detection -> Continuous Dynamic

Please note this is more resource intensive, but is much less likely for collision to occur. This is issue commonly missed in answer forums on collision.

As an alternative to using a mesh collider, it is possible to use the much faster sphere collider. Just put many differently sized sphere colliders throughout the mesh area. Here is a complete example of how to do this:

http://isg.cs.tcd.ie/spheretree/

The source code can be downloaded at the bottom of the page. I would recommend fully reading the article first though.

i had this problem once, the problem was that i accidentally put a mask on the Base Layer, making my character to fall through the ground.

I have the same issue only it happens inconsistently.

I have parented objects (quads) in my scene. When i drop a bouncing ball on the parent quad, it collides properly and bounces, but when the ball intersects with on of the children quads, the ball falls through it, even though it has all the identical attributes as the parent. The children quads were all created from duplicating the parent quad.

Also accidentally adjusting Thickness of the terrain in the terrain settings below 1 can cause this.

I found a really weird solution. What I was doing wrong was that instead of moving the whole cardboard asset, I was only moving the main lens. I am new to Unity and it has been just days so I feel really stupid

Lets say you have a game kind of like Dragon Age, with a controlled character and other characters “following” with NavMesh, then you could have problems if your movement script and char animations are not using kinematic.

I had the same problem. I followed the following checklist

  1. Remove Rigid body from ground
  2. Add a empty else class in the OnTriggerEnter Function

My function code was as follows

function OnTriggerEnter (other : Collider) 

	{
		if (other.gameObject.CompareTag("Pick UP")) 
		{
		other.gameObject.SetActive (false);
		}
		else
		{}
	}

can I share project and someone can help me understand by my gameobject is going through roof and ground? If so please share email address

why cant i read any of the response here?!