- Home /
Character Controller and Rigidbody intersect on collision. Bad.
Ok. I'm submitting another question because I think I have found the specific problem to the question I've had for the past 2 weeks. Link Here.
When the player (Character Controller) runs into the enemy (rigidbody) while the enemy is moving, the enemy gets pushed. It looks like this is because the colliders are intersecting and getting stuck together. So when I walk in that direction, I push the enemy. However, if I walk in the other direction and then run back into the enemy (while it's not moving), then the player collides into the enemy and stops.
Here is a link to what it is doing (note it is not that choppy. the fps was cut in the screen cap): LINK
Here is a link to the Script for the enemy: Link
What do you know about layer-based collision? It seems to me (having read your previous question) that that is what you need here.
No, I want the player to run into the enemy and stop, just like it hit a static collider. The problem is, it pushes it, and I think this is because it's getting stuck in the enemy's collider.
$$anonymous$$ove with AddForce ins$$anonymous$$d of $$anonymous$$ovePosition.
$$anonymous$$ovePosition will draw a line between your points of movement and see if there are any colliders in the way. This could register multiple collisions.
I am moving my Enemy(RB) with AddForce. I am moving my $$anonymous$$ainCharacter with CharcterController.$$anonymous$$ove, since I don't think u can use AddForce on CCs...
Your answer
Follow this Question
Related Questions
Character Controller with rigidbody 2 Answers
Making a Character Controller push another Character Controller 3 Answers
Ethereal Character Controller 2 Answers
Rigidbody vs. Character Controller 2 Answers
How to setup character Collisions? 2 Answers