Character Controller Collision problem

hello!

i added a character controller to my player because physics did not work. when i drop the player into the world he collides with the bottom (a cube) and stands on it. then i move the player with

Vector3 oldPosition = transform.position;
			oldPosition.x = oldPosition.x + 1.0f;
			transform.position = oldPosition;

the player moves around on the floor as he should. then there comes a wall that is an exact copy of the bottom and it stands in the players way. he just moves through.

can anyone tell me why? it makes no sense to me that the bottom reacts correctly but the wall does not. i expected the player to stop at the wall the same way as he does on the bottom.

thanks in advance for your help!

Using transform.position essentially teleports an object - it doesn’t take collision into account.

The Character Controller has it’s own movement function which will handle collision.

See the reference manual for CharacterController.Move;

makes perfect sense :slight_smile:

thanks alot!