x


My Character Controller is falling through... everything...

Simply put, every time I apply a Character controller to an object, it falls through the floor. I'm working on some scripts right now and I'm using basic primitives (spheres and cubes) as the characters in the game. Every time I apply the controller to the character, he falls through any object I put below him.

In previous versions of unity, this wasn't a problem. But now when the Rigid Body and Controller are in place there seems to be no collision. The objects that make up the floor are set as collider, trigger is not checked.

If I also apply a collider (cube or sphere) to the character, it sits fine on the floor, but then the controller can't seem to recognize commands or states (i.e. grounded).

Any help would be fantastic!

Edit: It may also be important to note that the character controller reacts the same way with or without any scripting on.

more ▼

asked Dec 17, 2012 at 10:56 PM

MSW Games gravatar image

MSW Games
16 3 2 3

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

3 answers: sort voted first

Add a rigidbody on the floor plane as well and character will not fall through.

more ▼

answered Dec 17, 2012 at 11:09 PM

ZenithCode gravatar image

ZenithCode
1.1k 14 20 29

This did not work.

Dec 17, 2012 at 11:14 PM MSW Games

Do you have a collider on the plane? If yes, try replacing the plane with a stretched cube and repeat the above.

Dec 17, 2012 at 11:25 PM ZenithCode

The current floor is a stretched cube. I have also tried it with a terrain and a plane. All of which had colliders.

Dec 17, 2012 at 11:28 PM MSW Games

Move the character controller's object higher above the ground object. sometimes it takes a second for unity to realize collisions at start of game (due to object initialization) and therefore having a character controller too close to the ground can cause it to fall and not register the collider on the ground. make it about 4 or 5 units above the ground (4 or 5 above the character controller not touching the ground). Tis should work. I had a similar problem and this seemed to solve it. An ordering of scripts or such in the execution order pane might solve this but I am unsure.

Jan 04, 2013 at 03:33 PM 1337GameDev
(comments are locked)
10|3000 characters needed characters left

Make sure that in the field under your terrain collider where it asks for "terrain data" that you have selected your terrain (when you click on the little circle, the box will pop up and you can choose your terrain; it defaults as "New Terrain")alt text

more ▼

answered May 09, 2013 at 07:44 PM

blumenkohlfrau gravatar image

blumenkohlfrau
1

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

In Unity 3.0 you can't use character controller and rigidbody with a single gameObject. You need to write your own gravity scripts in order to simulate gravity's effect. And don't use transform.Translate since it skips all collider checks.

You move objects with rigidbody by addForce() function and objects with character controller you move with SimpleMove() or Move(). These translate functions do have collider checks when you use them.

Also remember to check if all the objects have colliders.

more ▼

answered May 09, 2013 at 11:20 PM

EmJay gravatar image

EmJay
1 5 8 9

(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:

x4100
x2872
x1490
x310

asked: Dec 17, 2012 at 10:56 PM

Seen: 3662 times

Last Updated: May 09, 2013 at 11:20 PM