- Home /
Rigidbody + Character Controller = flight?
Hello. I have a simple cube-shaped enemy character that has a rigidbody. When I add a character controller to him (for use with an AI system) it starts moving backwards at extreme speeds, ultimately turning upward and becoming a flying cube that loops and loops and is eventually never seen again as it flies beyond the player's range of vision. Is this a glitch, or a Unity bug? I confirmed that the collider is not in the ground. I also noted, though, that if the collider is smaller than the cube itself. than the previous events don't occur - it simply ignores the collider and falls through the floor. What have I done wrong here?
Answer by Slev · Sep 19, 2014 at 12:53 PM
You need to remove the rigidbody. Character Controllers and Rigidbodies do not play nicely. The reason you're seeing the issue is the Character Controller is actually Colliding with the Rigidbody. If you desperately want both you could use layers and interaction flags, but honestly, you should almost never combine Character Controllers and Rigidbodies as the Character Controller handles all the physics.
Alright, thanks. I will try to get my setup working without a rigidbody.
Your answer
Follow this Question
Related Questions
Character Controller Component Makes the Player Pass through Hills, Rocks, Trees, etc! 0 Answers
Is moving a collider without rigidbody bad? 1 Answer
How to setup character Collisions? 2 Answers
Using character controller insted of normal collider 0 Answers
Limiting rigidbody physics influence on another rigidbody 0 Answers