Charachter goes through the cube

i’ve just made a cube as the ground and a sphere for the charachter.
now i’ve added CharachterController to the sphere and also this script :

var speed : float = 3.0;
var rotateSpeed : float = 3.0;

function Update () {
var controller : CharacterController = GetComponent(CharacterController);

// Rotate around y - axis
transform.Rotate(0, Input.GetAxis ("Horizontal") * rotateSpeed, 0);

// Move forward / backward
var forward : Vector3 = transform.TransformDirection(Vector3.forward);
var curSpeed : float = speed * Input.GetAxis ("Vertical");
controller.SimpleMove(forward * curSpeed);


@script RequireComponent(CharacterController)

now my problem is, whenever i start the game. my sphere goes right through the cube :S the cube should be solid by the Box collider…

thanks for the help already :slight_smile:

its hard to tell from my point of view but i think the problem inst in the code but with your character controllers collider. is the spheres collider slightly inside the boxes? if so try starting the game with the sphere suspended in air above the cube so it falls ontop of the box. also make sure the boxes collider is not a trigger.

checked the trigger and it’s no trigger :wink:
also the sphere was far above the cube, hehe :stuck_out_tongue: looked on other topic whith this problem, but more people got this problem whith newer version :S something to do whith the charachter controller, i read :stuck_out_tongue: but haven’t found a solution :S