Search Unity

Feature Request Allow character controller to use other colliders other than capsule collider

Discussion in 'Editor & General Support' started by marcus_cheong4, Apr 4, 2023.

  1. marcus_cheong4

    marcus_cheong4

    Joined:
    Nov 4, 2019
    Posts:
    5
    Character controller is really useful for us to create a movement script which can take into account the traversable angle of a slope as well as stairs up to a certain height. However, I find it really inflexible due to the fact we do not have at least a choice on what collider the character controller uses as it is already using a capsule collider which is built-in. My characters dimensions on the X and Z axis is of different width and length however a capsule collider only accepts a radius value which means my character will have too much empty space either on the X or Z axis. I believe, it would be beneficial to at least allow us to choose the type of basic shape colliders that we want to use for our characters rather than only setting the character controller to use capsule collider all the time.
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,914
    It's a nice thought but it will never happen. CharacterController is not really a Unity feature but a wrapper around a PhysX feature. The whole "theory" around the CharacterController is based around the capsule shape.

    Read more here:
    https://docs.nvidia.com/gameworks/c.../physx/guide/Manual/CharacterControllers.html

    Your best bet is to use a Rigidbody-based controller wherein you can use whatever collider shapes you want.
     
  3. marcus_cheong4

    marcus_cheong4

    Joined:
    Nov 4, 2019
    Posts:
    5
    Thanks for the info. I didn't know that CharacterController was not actually made by Unity which was why I thought they could enhance it with a feature that would allow us to select out own 3D shape collider. Because previously I tried to create my own RigidBody controller but found myself getting really frustrated with how annoying it was to handle moving on a slope and steps. While researching about RigidBody, almost everyone keeps saying to just use CharacterController which was annoying. But then, I decided to make a prototype of both CharacterController and RigidBody movement controllers and found it really easy to handle movement on slope and stairs with CharacterController. That was until I tried making Inverse Kinematics for the feet to match the terrain's height and angle. The capsule collider made it really hard to bring down my feet to ground level on a slope since it was too big on Z- axis because I made the radius match the X-axis. I also noticed, When walking off the edge, the character also sometimes get stuck midair as the capsule is too big on the Z-axis. So I was wondering why we couldn't just set the CharacterController to use a box collider instead which would allow it to fit the character dimensions better. I guess I'll have to go back to a RigidBody controller instead.