- Home /
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?
Answer by Ehren · Aug 18, 2010 at 06:26 PM
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.
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.
Answer by Dudechester · Aug 28, 2020 at 02:24 PM
Is there an example of WHY you need skin width please to get a better understanding of why you'd need it at all? Thanks.
Your answer
Follow this Question
Related Questions
How to I make my player push off of the ground? 0 Answers
Prevent rigidbody being affected by character controller 2 Answers
Prevent player from "Running Over Top Of" specific colliders. 0 Answers
Lunging with Character Controller 0 Answers
What is the best way to prevent a physics object from going through thin colliders? 2 Answers