- Home /
Why does my character keep falling?
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.
Answer by Ostagar · Oct 29, 2010 at 03:24 PM
This is a common issue when starting out with Unity. Double-check these things:
- Ensure your player's position.y is well above the floor.
- Ensure the floor and player both have colliders
- Ensure isTrigger is off on those colliders.
I have done all of these things which is why i cant understand what is going on :(
Answer by soulzero · Oct 29, 2010 at 03:15 PM
Be sure to add a collider to the floor? And make sure that your character is placed above the floor collider?
Answer by elbon96 · Oct 29, 2010 at 03:17 PM
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.
Answer by ilhokim · Feb 13, 2011 at 09:56 PM
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.
still player falls through the floor.
Answer by Ashment · Feb 13, 2011 at 11:53 PM
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...
Hope this helps
-Ashment-
Your answer
Follow this Question
Related Questions
how to create Objectives 1 Answer
My character falls through the terrian 7 Answers
Character falling backwards! 1 Answer
GAMEOVER SCRIPT for worm game 2 Answers
Falling through platforms 1 Answer