- Home /
CharacterController gets pushed by RigidBodies
Hello Community
My CC gets pushed by moving Rigidbodies. Is there a way to avoid this? I use the DragRigidbodies.js Script from the wiki and whenever I drag one and it collides with my CC, my CC gets pushed away from the RigidBody.
The dragged RigidBodies are set to kinematic by the script, could this be the problem?
I hope someone has an idea how to fix this :)
Thanks in advance!
I think it would be helpful to mention what you WANT to happen.
I just want the CC to be "stronger" that the rigidbodies but still collide with them. The CC's position should only be changable through script and not thorugh collisions with rigidbodies.
The object that has the CC set the mass of that object's rigidbody to something like 1000.
You shouldn't use a CC and a rigidbody on the same object and I won't do that.
Answer by James U · Jul 13, 2013 at 08:52 PM
It seems that you have a RigidBody attached to your CharacterController. From Unity's Reference Documentation, it seems like they suggest not using both a CharacterController and a RigidBody for the same object.
Read this if you haven't.
At the bottom, it says, "The Character Controller can not be affected by objects through physics."
Nope, please look at the comment above, that's what I told cdrandin. The thing is, that the rigidbodies are $$anonymous$$NINE$$anonymous$$ATIC, so there is no physic at all. $$anonymous$$inematic rigidbodies push my CC.
If that is the case, then could you do something that if such objects are very close to each other then ignore the collisions using Physics.IgnoreCollision
.
Well, I still need collisions. The thing I want to reach is "$$anonymous$$ake my CC not movable by kinetic rigidbodies". But thanks for trying to help me. I'm getting mad with this problem!
Ok, so how do you want the objects to react when CC runs into them? I mean, will they then behave like normal physics? Will they turn around going at the same speed? Because you'll probably have to code exactly how you want them to act.
This issue only appears, when the objects are dragged by the DragRigidbody.js script, so the CC will not "run" into them. But when they collide while they are dragged, they should just be "blocked" by the CC, Like the CC was a fixed wall and not movable. I found another dragging script, I'll try this tomorrow, maybe it works better :) Thanks again for trying to help me.