x


CharacterController.skinWidth and vertical displacement

I'm mostly unfamiliar with CharacterController, so I was wondering if anyone here could enlighten me.

Characters using CharacterController are floating above the ground at the height of SkinWidth. From the Unity documentation, I wouldn't have expected that - it reads:

"Two colliders can penetrate each other as deep as their Skin Width."

So I'd interpret it as quite the opposite - the leeway that it has before repelling.

Other pages referring to the parameter on PhysX confirm that

"The skin allows the objects to penetrate each other, at the width of the skin. "

So I'm wondering why I would get it to actually repel from the ground (or box/plane collider below it) at that height. The behavior is the same on 2.6 and the 3 betas, so I imagine this is expected, but can anyone elaborate?

more ▼

asked Aug 18 '10 at 05:18 PM

Ricardo gravatar image

Ricardo
5.2k 20 32 96

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

1 answer: sort voted first

EDIT: Yes, the skin width will add a buffer around the character's collider.

If your character is standing still on a platform, the buffer won't be penetrating the platform's collider. This will cause the character to "float" if you haven't adjusted the collider height to account for skin width.

The skin width only comes into play when motion results in collider penetration. It doesn't mean the colliders will always penetrate to that depth.

more ▼

answered Aug 18 '10 at 06:26 PM

Ehren gravatar image

Ehren
4.2k 34 43 77

Hi Ehren. Like you said, I expected the skin widdth only to come into play when dealing with collider penetration, as a sort of leeway, which is why I was a bit surprised by it also causing a displacement from what Unity displays. Indeed, I ended up accounting for the distance in the collider height.

Aug 19 '10 at 06:54 AM Ricardo
(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:

x1877
x675
x51
x3

asked: Aug 18 '10 at 05:18 PM

Seen: 1364 times

Last Updated: Aug 18 '10 at 05:24 PM