Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question What is the point of CharacterController.SkinWidth

Discussion in 'Physics' started by QtTx, Sep 11, 2021.

  1. QtTx


    Aug 20, 2021
    Hi. I have read the documentation on CharacterController, and it briefly mentions that skin width helps reduce jitter and the chances of character getting stuck. Can someone elaborate? I am looking for a more in depth explanation. Like, in what specific scenarios would a character jitter/get stuck if a single capsule was used, and how having an additional smaller capsule (which I assume is what SkinWidth translates into) solves those problems. Thanks.
  2. r31o


    Jul 29, 2021
    As long as I know skin width let the character controller "penetrate" into colliders. The character could jitter if for example, having a diameter of 1 (radious of 0.5) will try to go through a space of 1 meter. With the skin width the character will kinda "penetrate" a bit into the colliders so it wont do strange things.

    All if this is what I think it does, I'm not sure if my info is 100% correct. Correct me if I'm wrong.
  3. BakeMyCake


    May 8, 2017
    Mention in the manual:
    Mention in the script reference:

    Regarding this bit:
    Coordinates in Unity are floats, and floats have varying precision depending on the value being stored:
    It isn't as bad on its' own, but when you have multiple floats and you add them up the imprecision gets more pronounced.

    Imagine you have a capsule in slight contact with the ground and moving parallel to it. Sometimes it can report as being slightly inside the ground and sometimes slightly above it. I guess the way Unity deals with it is by allowing distance related calculations to operate using a "close enough" range.

    But that's only one reason, there may be more.