- Home /
My Character Controller is falling through... everything...
Simply put, every time I apply a Character controller to an object, it falls through the floor. I'm working on some scripts right now and I'm using basic primitives (spheres and cubes) as the characters in the game. Every time I apply the controller to the character, he falls through any object I put below him.
In previous versions of unity, this wasn't a problem. But now when the Rigid Body and Controller are in place there seems to be no collision. The objects that make up the floor are set as collider, trigger is not checked.
If I also apply a collider (cube or sphere) to the character, it sits fine on the floor, but then the controller can't seem to recognize commands or states (i.e. grounded).
Any help would be fantastic!
Edit: It may also be important to note that the character controller reacts the same way with or without any scripting on.
Answer by ZenithCode · Dec 17, 2012 at 11:09 PM
Add a rigidbody on the floor plane as well and character will not fall through.
Do you have a collider on the plane? If yes, try replacing the plane with a stretched cube and repeat the above.
The current floor is a stretched cube. I have also tried it with a terrain and a plane. All of which had colliders.
$$anonymous$$ove the character controller's object higher above the ground object. sometimes it takes a second for unity to realize collisions at start of game (due to object initialization) and therefore having a character controller too close to the ground can cause it to fall and not register the collider on the ground. make it about 4 or 5 units above the ground (4 or 5 above the character controller not touching the ground). Tis should work. I had a similar problem and this seemed to solve it. An ordering of scripts or such in the execution order pane might solve this but I am unsure.
Answer by blumenkohlfrau · May 09, 2013 at 07:44 PM
Make sure that in the field under your terrain collider where it asks for "terrain data" that you have selected your terrain (when you click on the little circle, the box will pop up and you can choose your terrain; it defaults as "New Terrain")
Answer by EmJay · May 09, 2013 at 11:20 PM
In Unity 3.0 you can't use character controller and rigidbody with a single gameObject. You need to write your own gravity scripts in order to simulate gravity's effect. And don't use transform.Translate since it skips all collider checks.
You move objects with rigidbody by addForce() function and objects with character controller you move with SimpleMove() or Move(). These translate functions do have collider checks when you use them.
Also remember to check if all the objects have colliders.
Answer by MagyarPeter · Jan 10, 2021 at 08:14 PM
Same here. Everything worked, until I imported the NewInputSystem's mobile tutorial assets. Now, mí character faling throught everything, even if I just put the character controller at an unused Gameobject.
The character is far above the ground, the ground has collider, the physic layers are fine, it's not a trigger, It's worked a minute ago.