Search Unity

CharacterController Algorithm

Discussion in 'Scripting' started by TheShane, Dec 5, 2013.

  1. TheShane

    TheShane

    Joined:
    May 26, 2013
    Posts:
    136
    I am trying to extend the CharacterController so I can customize it. Primarily, I need it to be able to change its orientation (to make it possible to support changes in gravity direction). While I am at it, I was also thinking to generalize it to use any of the primitive collider types or combinations of them together (three spheres to more accurately represent a snowman, for example).

    I am looking for a description of how the algorithm for the character controller works with regards to the skin width, step offset, slope limit, etc. I understand the broad strokes, but it would help to have some exact details of how it is implemented. I'd like to have it duplicate the behaviour of the standard character controller as closely as possible (when used upright with a capsule).

    Obviously, the source code for the existing CharacterController would be perfect, but I do not think that is generally available. Failing that, does anyone know any references for the algorithms they used? Or general algorithms for developing character controllers?

    I've been trying to Google for a while, but I'm having trouble finding any relevant results. "Character", "controller", "collision", etc. are very generic terms, and I am having trouble thinking of terms to use to appropriately narrow down the search.

    Any help would be appreciated! I can likely muddle through on my own with enough experimentation, but it's frustrating having to reinvent the wheel just so I can modify it a bit.