- Home /
Character Controller Object Randomly Falls Through Colliders
Hello guys; just a warning, this is a bit of an explanation. But there are pictures!
Was wondering if someone can help me out. I've been using Unity for over a year now so I am mostly sure I am not being completely dumb here. Bit of context:
The level contains a room. The room's floor is made up of tiles (it's a randomly generated room). Each tile contains a box collider slightly larger than itself (done due to these issues I am having as an attempted solution - but to no avail).
The player uses a Character Controller and has a kinematic rigidbody component also attached (required to pick up collisions, as far as I am aware). I am moving the character using the SimpleMove function, however the same issue occured when using the standard Move function, and adding gravity manually when isGrounded returned false. The level has gaps in the floor in locations which is why falling/gravity is required.
My issue is this; 9 times out of 10, every tile in the room is perfectly fine. Can move around the room without any issues. However about 10% of the time, there will be a single tile in the entire room which the player just falls through, despite it being exactly the same as all other tiles in the room. I do not understand why this happens. This problem persists even after moving the tile to a new location, moving the player back above the floor, going out of the room and back into it again (leaving a room disables the room's contents and enables the destination room).
Duplicating this "faulty" tile does not replicate the problem. The copy works as expected; player never falls through. Rebuilding the room with the exact same seed does not replicate the issue, either. It seems entirely random, yet weirdly consistent when it actually occurs.
Here is a screenshot of the faulty tile (increased its height so its collider dimensions could easily be seen). https://gyazo.com/f1605218c021192ccecbda076f43af98 The sphere collider seen is a trigger attached to the child of the tile. Thought that should be mentioned.
Here is also a screenshot of the components attached to the faulty tile; literally just the box collider. https://gyazo.com/73089eb6da4420078e34b20fc880d457
Really hope this can be resolved as it is heavily hindering progress on the game.
Thank you for your time.
Have you experienced this in Unity 5.5? I am having the same problem, just updated, and believe I may still be experiencing this for a title my studio is launching in February this year.
Answer by NullPointer93 · Nov 23, 2016 at 09:30 PM
It seems to have been a bug in Unity 5.4.1. Since updating to 5.4.3, it has not happened once. Hopefully it is this and nothing more!
Wish this was true. Just filed a new bug report and recorded video of it occurring in 5.5. Unfortunate :/
https://www.youtube.com/watch?v=o80an6j6d04
https://fogbugz.unity3d.com/default.asp?868875_a8321l5ba9rcgjss
Answer by atmosgames · Jan 19, 2017 at 06:07 PM
Replicated in Unity 5.5. Here's what Unity said about a bug report I submitted:
I was successful in reproducing your bug and got some details about it from the developers.
This is an issue that people tend to run into when using the Character Controller that ships with Unity. Unfortunately, this character controller was written by the folks over at PhysX as an example, and only became a feature addition because it was so widely used. It uses very patchy code that is hard to debug.
Fortunately, in light of all the complaints received about the CC, we have decided to expose a PhysX method that will go leaps and bounds in aiding users to write their own character controller. It’s the Physics.ComputePenetration method and it will be available from Unity 5.6 going forward. If you’d like to check it out, 5.6 is in Beta right now.
Your answer
Follow this Question
Related Questions
Collision between CharacterControllers 1 Answer
3rd person Character Control with kinect 0 Answers
A Rigidbody moving in a moving Rigidbody 0 Answers