x


Quadrupeds Character Controller

Is there a Character Controller equivalent for Quadrupeds?

My main character and NPCs are quadrupeds animals. I have been using the Character Collider, but the problem is that the player and the NPCs can stick their heads or tails into other characters, which I want to avoid. I tried adding Box colliders to the GameObjects, but they don't seem to work. Is there any way to change the default Character Controller collider shape? like changing the default capsule for a box collider?

Is there another way to solve this? Mesh colliders? Box colliders? Can I have both the Character Controller component and a Box Collider at the same time in the same GameObject? Is there any difference if the secondary Box Collider is attached to a child object of the one that has the Character Collider? What would I need to do at scripting level to make it work?

Any help is more than welcome.

Thanks

more ▼

asked May 26 '10 at 07:16 PM

Arbbot gravatar image

Arbbot
90 5 5 11

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

After a really deep research on available options, the only solution I found is to sacrifice Top collisions accuracy to have side collision accuracy. This means that you can still use the CharacterController standard Unity component, and just make it a lot taller than the actual model. This will give you a better shape for side collisions although the CC collider will be a lot taller than the model, which means that top collisions will not be accurate, but at least this works fairly well. By the way, locomotion does not solve this problem, and it doesn't have anything to do with the actual CharacterController colliders. It actually uses the same Unity CharacterController component.

more ▼

answered Jun 14 '10 at 06:18 PM

Arbbot gravatar image

Arbbot
90 5 5 11

@Joseph Pasek Thank you. Your option helped solve my problem. I just minimized the Character Controller x,y,z all to 0 and attached empty object as a child. Then added box collider to it and resized it to be same as its parent. Wel Done. :)

Nov 24 '12 at 03:11 PM UNKNOWN
(comments are locked)
10|3000 characters needed characters left

I believe that it's only 1 Collider per GameObject. (If you try attaching a BoxCollider to an object that has a CapsuleCollider already, it'll prompt you to replace) However, that does not stop you from having sub-GameObjects that are just Colliders. That is a completely acceptable way of setting things up on your character.

MeshCollider objects will not collide with other MeshCollider objects, only primitive Colliders (Box,Sphere,Capsule... etc) unless marked convex.

--On a personal note I have found convex Colliders to act a little wonky in some instances, so avoid them if you're not familiar with how all of this stuff works.

Hope that helps.

==

more ▼

answered May 26 '10 at 07:28 PM

equalsequals gravatar image

equalsequals
4.5k 16 28 64

Thanks for your comment. I have my player GO with my Character Collider. Then, as a child object I have my animal model with a box collider attached. The box collider is a little bigger than the actual model mesh, which is fine. However, I can still stick the head on the animal into other objects and characters. What else do I need to do in order to avoid this? Do I need to check for the model's box collider collisions in my Third Person Controller scripts? I'm not sure if the Box Collider generates the collisions by default, or if I need to check for them in my TPC.

Thanks

May 26 '10 at 08:05 PM Arbbot

Just to clarify: I have my "player" GO with a Character Controller attached to it (with its capsule collider). Then, as a child object, I have an empty GO with a box collider that covers the space of the child GO that contains the model mesh. But it doesn't solve the issue. What do I need to do to get the BoxCollider collisions right?

  • Player GO (character controller) -- Collider Container GO (box collider) --- Model GO (mesh)

Thanks

May 26 '10 at 08:24 PM Arbbot

Unity will handle all the collisions for you, the only way the tails/heads will come in contact with anything outside of the encapsulating Collider is if A) part of the mesh protrudes from the Collider B) The object it is clipping with does not have a Collider encapsulating it entirely.

May 26 '10 at 08:56 PM equalsequals

Still not working. - Player GO: has a Character Controller with the capsule collider it comes with it. The capsule collider is smaller than the child GO containing the animal model Mesh. -- BoxCollider Container GO: child of the player GO with a Box Collider bigger than the child object containing the animal model mesh. --- Animal Model GO: contains the animal model mesh.

May 26 '10 at 09:38 PM Arbbot

At the higher level I'm using a character controller. And in the child object I have the box collider (isTrigger = false). But still, when the player gets near other characters, I can still stick my head into the other characters, which shouldn't happen. Both characters, the player and the NPC have a character controller, and both of them have a child object with a big box collider.

May 26 '10 at 09:38 PM Arbbot
(comments are locked)
10|3000 characters needed characters left
more ▼

answered May 26 '10 at 07:29 PM

Tetrad gravatar image

Tetrad
7.2k 27 37 89

I already saw this thread, but as far as I understand, the locomotion system doesn't solve the character collision problem. Am I right?

May 26 '10 at 08:06 PM Arbbot
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1704
x1047
x524
x5

asked: May 26 '10 at 07:16 PM

Seen: 3245 times

Last Updated: Nov 24 '12 at 03:11 PM