The object with collider only decect the ground

Hi! I’m using an object with a box collider, but only collides with the ground, with walls around it goes inside.
In scene has a box with a box collider inside a room.
This is the code:

var speed = 6.0;
var jumpSpeed = 8.0;
var gravity = 20.0;
var jumpCount = 0; 
var maxJump = 2; 
var Player : Transform;
var RotateSpeed : int;
var Speed : float ;
private var moveDirection = Vector3.zero;
private var grounded : boolean = false;

function OnCollisionEnter() 
{ 
	jumpCount = 0; 
} 

function Update() 
{
	if (grounded) {
			
		jumpCount = 0; 
			
		if (Input.GetButtonDown("Jump")) 
		{
			moveDirection.y = jumpSpeed;
			jumpCount++;
		}
	}

	moveDirection.y -= gravity * Time.deltaTime;
	
	var controller : CharacterController = GetComponent(CharacterController);
	var flags = controller.Move(moveDirection * Time.deltaTime);
	grounded = (flags  CollisionFlags.CollidedBelow) != 0;
	
  	if (Input.GetKey("w"))
    {
    	transform.Translate(Vector3.forward * Speed);
    }
    if (Input.GetKey("s"))
    {
        transform.Translate(-Vector3.forward * Speed);
    }
    if (Input.GetKey("a"))
    {
        transform.RotateAround(Player.position, Vector3.up, RotateSpeed * Time.deltaTime);
    }
    if (Input.GetKey("d"))
    {
        transform.RotateAround(Player.position, Vector3.up, -RotateSpeed * Time.deltaTime);
    }
}

@script RequireComponent(CharacterController)

How can I fix this collision to the walls too?

How are the walls colliders constructed? (Mesh colliders, primitives…)

I did with menu gameObject > Create Other > Cube and made a wall with the scale.

For example when I use a third person character from assets this works, but with this box with this code doesn’t works.

I found a way but only changing the entire code.
I thing I miss one processure in line code that make this collision works.

This is the code:

var speed = 6.0;
var jumpSpeed = 8.0;
var gravity = 20.0;
var jumpCount = 0; 
var maxJump = 2; 
var Player : Transform;
var RotateSpeed : int;
var Speed : float;

private var moveDirection = Vector3.zero;
private var grounded : boolean = false;

     //Reset jumpCount
	function OnCollisionEnter() { 
		jumpCount = 0; 
	} 

	function Update() {
	if (grounded) {
		jumpCount = 0; 
		moveDirection = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
		moveDirection = transform.TransformDirection(moveDirection);
		moveDirection *= speed;
		if  (Input.GetButtonDown("Jump"))  {
			moveDirection.y = jumpSpeed;
			jumpCount++;
		}
	}
	
	// Apply gravity
	moveDirection.y -= gravity * Time.deltaTime;
	
	// Move the controller
	var controller : CharacterController = GetComponent(CharacterController);
	var flags = controller.Move(moveDirection * Time.deltaTime);
	grounded = (flags  CollisionFlags.CollidedBelow) != 0;
    
		//Run Toggle
		if (Input.GetKey (KeyCode.LeftShift)) 
			speed = 13;
	else 
			speed = 6;
}

@script RequireComponent(CharacterController)

Now a collision occurs. My tip is to use charactercontroller correctly regardless of what you want to do. Thanks for the help!