[Solved] Collision Help

I’m working on my first iphone game, but I’ve run into a pretty big bug. I’m using a camera relative setup with joysticks and a jump button. I already imported my landscape and my character, but my scripts were not working. After a lot of debugging, I’ve determined it’s because my scripts don’t think my character is on the ground. So, I put my character above the ground to see if it would fall and it didn’t. I have a rigidbody and a character controller on it. I checked to make sure I have gravity on my rigidbody. I have also tried to put penelope into my scene since I just did that tutorial and penelope doesn’t seem to have gravity in my scene either although she works fine in the tutorial. I have also put my player in Penelope’s world and it still will not jump so I’m assuming it’s just something stupid I’m doing I just can’t figure out what. So if someone could point my in the right direction it’d be greatly appreciated.

A rigidbody generally doesn’t work very well with a CharacterController. The rigidbody is used to simulate realistic physics while the controller registers collisions but deliberately avoids realistic acceleration, etc. At some point in the script, the CharacterController component will be moved using its Move or SimpleMove functions. These take a vector to specify the direction and speed of the motion. To simulate gravity, you just need to add a downward component to the movement vector:-

var gravStrength: float;
   ...

function FixedUpdate() {
   var gravity = -Vector3.up * gravStrength;
   var movement: Vector3 = <values from inputs>;
   movement += gravity;
   controller.Move(movement * Time.deltaTime);
}

Thanks for the explanation, I kept my rigidbody and added a capsule collider instead of using the character controller and everything works fine now.