x


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.

more ▼

asked Oct 29, 2010 at 02:38 PM

JetMasta gravatar image

JetMasta
11 3 2 4

(comments are locked)
10|3000 characters needed characters left

6 answers: sort voted first

Be sure to add a collider to the floor? And make sure that your character is placed above the floor collider?

more ▼

answered Oct 29, 2010 at 03:15 PM

soulzero gravatar image

soulzero
702 6 7 29

(comments are locked)
10|3000 characters needed characters left

This is a common issue when starting out with Unity. Double-check these things:

  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.
more ▼

answered Oct 29, 2010 at 03:24 PM

Ostagar gravatar image

Ostagar
166 3 4 10

I have done all of these things which is why i cant understand what is going on :(

Oct 29, 2010 at 03:34 PM JetMasta
(comments are locked)
10|3000 characters needed characters left

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.

more ▼

answered Oct 29, 2010 at 03:17 PM

elbon96 gravatar image

elbon96
142 14 12 18

(comments are locked)
10|3000 characters needed characters left

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.

more ▼

answered Feb 13, 2011 at 09:56 PM

ilhokim gravatar image

ilhokim
1

(comments are locked)
10|3000 characters needed characters left

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-
more ▼

answered Feb 13, 2011 at 11:53 PM

Ashment gravatar image

Ashment
21 3

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1506
x141
x44
x20

asked: Oct 29, 2010 at 02:38 PM

Seen: 4196 times

Last Updated: Nov 06, 2010 at 05:41 AM