- Home /
CharacterController Collision causing teleportation?
So, essentially here is my problem. I have player character that moves using a script, and a character controller. The script takes in input, and supplies it to the character controller.
However, if anything (such as an NPC) walks into my player, the player teleports on top of them
Answer by oswin_c · Oct 13, 2016 at 07:00 AM
You are simply "stepping" on top of the NPC. This is normal behavior.
Please note the following facts about what the character controller does and does not do. A character controller does...
...prevent your character from walking through walls.
...prevent your character from falling through the floor.
...prevent your character from using corners as teleportation devices.
...make movement consistent up slopes.
...allow the character to move up steps.
A character controller does not...
...react to gravity / fall.
...care what you are stepping on.
...give a sensible velocity with this.velocity.
You simply need to adjust the step size on your character controller component so you don't step on enemies, and add things like gravity.
Your answer
Follow this Question
Related Questions
Character controller, player y changes when pushing on colliders 1 Answer
Help in Javascript destroying Objects using character controllers and conditionals 1 Answer
Box collider with rigid body yet enemies still pass through each other. 1 Answer