- Home /
CharacterContronller characters colliding with Rigidbody characters
I'm setting up a scene where I have one charactercontroller player character and several rigidbody enemies. I'm using rigidboy enemies since I saw a huge peak in the time the Update function takes if I have several character controllers colliding with each other. Using rigidbodies seems to have overall less impact on performance, but it gives me other problems.
As far as I understood, the charactercontroller is not directly handled by physics, but just resolves movement when colliding with colliders for you. However when colliding with rigidbodies that move around it appears to collide with them (and get stopped) some times, and shove them away other times.
The charactercontroller is unable to move resting rigidbodies, but shoves around rigidbodies that are already in motion. I've not made any functions on the charactercontroller to allow it to apply forces to rigidbodies, so I'm assuming that it's just a moving rigidbody that's trying to react to another collider while moving.
The rigidbodies are moved with the RigidBody.MovePosition() in FixedUpdate(), and the CharacterController with CharacterController.Move() (about the same result if I run the Move() in Update or FixedUpdate).
The scene is a normal fixed camera plane with the character moving around in XZ and the rigidboy enemies seeking the player.
What I'd prefer is that neither of them can push each other around, that they merely get stopped when trying to move into each other. Anyone had experience with this?
Answer by Sitrane · Nov 13, 2011 at 09:24 PM
I'm not sure if this will solve your problem but I use this script to move objects around in my scene.
There is a push power option and if you set it to 0, the object you collide with (In my case my barrels with Rigidbody colliders on them) do not move. You simply collide like normal.
Hope this helps!
P.S. I am not a coder by any means and am rather new to Unity, so I apologize if this isn't even close to what you need.
Your answer
Follow this Question
Related Questions
Any way to ignore collision between rigidbodies and colliders/character controllers? 1 Answer
Is there a rigidbody character controller 3rd person that can handel stairs (steps)? 1 Answer
Collision between CharacterControllers 1 Answer
Can't use Rigidbody or Character Controller 0 Answers
Two Character Controllers Colliding... 0 Answers