Im following the tornado twins' tutorial on unity, the worm one.
I have been following it quite closely, however...
when i goto preveiw the game, my character simple falls through the floor.
Help!? much THANKS!
Ok here's a step by step of what i do.
1) select new scene.
2) game object> create other> cube
3) edit co-ordinats to 0,0,0. resize it to 25,0.3,25
4) add in point light
5) game object> sphere
6) component> game controller, message: add, replace, cancel. I hit add
7) add script to sphere: var speed = 3.0;
var rotateSpeed = 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 = transform.TransformDirection(Vector3.forward);
var curSpeed = speed * Input.GetAxis ("Vertical");
controller.SimpleMove(forward*curSpeed);
}
@script RequireComponent(CharacterController)
8) add smoothfollow to main camera, add sphere to main cam's target.
9) preveiw game, sphere falls thru floor, and camera follows.
You must make sure that both your player and your floor have colliders. If both have colliders, also be sure that your player is just above the floor, not touching it.
1.Ensure your player's position.y is well above the floor.
2.Ensure the floor and player both have colliders
3.Ensure isTrigger is off on those colliders.
You must make sure that both your player and your floor have colliders. If both have colliders, also be sure that your player is just above the floor, not touching it.
Ensure these things
1. Players y position is above floor, not touching
2. That both the Player AND the Floor have colliders
3. That both colliders do not have the isTrigger ticked
4. That at least one of the objects, Player, or floor, have rigid body component added to it.
(this is done by clicking the object first, and going to the top bar and clicking Component>Physics>Rigidbody)
If this still doesn't work, you are lame... just kidding, you can try to use character controller and use the simple move function.
**If this still doesn't work, you are truly lame... maybe not, you should just quit game development...
I'm wondering if this is a bug with the latest Mac version 3.2 Unity? I've been pulling my hair out with the same issue... done a very basic ball on the floor test with all the above;
set objects to 0,0,0 position
setup collider in floor and ball
set gravity on
etc
Can others with Mac 3.2 confirm that when testing a ball on the floor that the ball hits it? Can you give steps to do so? Any other ideas not covered in this thread already?