Script for colliding with a wall

Hi everyone, I’m creating a maze game for my final project at uni, but I am having quite a bit or trouble, i basically want my main charcter to walk into a wall and no go through it! But i dont know anything about rigid bodies or anything so all i have is a main charcter walking on a plane and a wall. here is the script to make the character walk:

var speed = 3.0;
var rotatationSpeed = 200.0;
private var curSpeed = 0.0;

function Update () {

		// Rotate around y-axis
		var newRotation = Input.GetAxis("Horizontal") * rotatationSpeed;
		transform.Rotate(0, newRotation * Time.deltaTime, 0);
		// Calculate speed
		var newSpeed = Input.GetAxis("Vertical") * speed;
		if (Input.GetKey("left shift"))
			newSpeed *= 1.5;

		// Move the controller
		var controller : CharacterController = GetComponent (CharacterController);
		var forward = transform.TransformDirection(Vector3.forward);
		controller.SimpleMove(forward * newSpeed);

		// Update the speed in the Animation script
		SendMessage("SetCurrentSpeed", newSpeed, SendMessageOptions.DontRequireReceiver);
		SendMessage("SetCurrentLean", Input.GetAxis("Horizontal"), 

Please help me. Thank for your time!!

If they have colliders they shouldn’t go through each other. If one of the colliders is a trigger then that collider won’t work for collision.

You don’t need rigidbodies when using the CharacterController - it verify collisions when moved with Move or SimpleMove, thus it should not go through other objects with your code. Does the wall have a collider? If not, add a box collider to it (Component/Physics/Box Collider). Another possibility: the CharacterController built-in capsule collider may not be adjusted to the model dimensions - adjust the fields Center/Width/Height in the Inspector, if necessary.