The player character in our game is a wolf and he has to navigate a Unity terrain with hills, rocks and trees etc. Since we can't rotate the character controller, what is the recommended method for putting a collider on a quadruped?
At the moment we're using the FPSWalker script to move the character around. We'd like to keep the same functionality, so i'm guessing we have to use something like a box collider and write a custom script? This shouldn't be a problem, but i'm thinking there might be issues when going up/down slopes, so maybe something like a capsule collider would work better?
I'd be keen to hear how other people have approached this.
asked Apr 30 '10 at 04:20 PM
Are you aware of the Locomotion System? As far as I know, it also works with quadrupeds.
Update: the Documentation says:
and includes a Coyote model for example.
i haven't used the character controller yet but my first thought would be to try two sphere colliders, one set to cover the hind legs/body and one for the front legs/body. drive the wolf by moving the forward collider and then let the rear one just follow along, possibly attached by a very stiff spring. that should keep the rear legs from falling through terrain and orient them properly when going up/down hills. swap ccontrol to the rear legs if you want him to be able to walk backwards.
answered Apr 30 '10 at 10:45 PM
Great information, but the Locomotion System actually used the default Character Controller with the default capsule collider. If you download the project and add a cube in the scene, you will notice that you can stick the Coyote's head into the cube.
After digging all around the Internet, including Unity official forums and answers, and even Thesis studies of Computer Animation Graphics using Unity, it seems that there's no way around the Character Controller default Capsule Collider. Either you don't use it at all, and use a primitive collider and create your own scripts, or use the default Character Controller.
Now the trick that kind of works, is to modify the default capsule collider to be very high and have the radius cover your model mesh. You need to make sure the capsule's height is high, otherwise characters will be able to walk over the CC capsule. This way you get better side collisions, sacrificing top collisions precision.
Let's hope that in Unity 3 we can modify the capsule to make different shapes, to match not only humanoid forms, but also animals and crazy shaped creatures.