My main character(exported form 3dmax) doesnt collide with anything around him!!... Ive tried making a new scene with some obstacles and it works perfectly, but soon as I bring it back to my scene ( where I have a terrain and some props made in 3dmax as well) it doesnt work at all, he just goes through the obstacles and doesnt collide with anything! I need some help!... it is very weird, because im doing exactly the same thing with the other scene is there a chance theres something to do with the .fbx?... Im using a character controller and this script:
var speed : float = 10.0; var jumpSpeed : float = 8.0; var gravity : float = 20.0;
private var moveDirection : Vector3 = Vector3.zero;
function Update() { var controller : CharacterController = GetComponent(CharacterController); if (controller.isGrounded) { // We are grounded, so recalculate // move direction directly from axes moveDirection = Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical")); moveDirection = transform.TransformDirection(moveDirection); moveDirection *= speed;
if (Input.GetButton ("Jump")) {
moveDirection.y = jumpSpeed;
}
}
// Apply gravity
moveDirection.y -= gravity * Time.deltaTime;
// Move the controller
controller.Move(moveDirection * Time.deltaTime);
}