- Home /
colliding characters and meshes
I have a game object with a character controller and a large mesh that moves around the screen. I want them to collide.
Currently, a collision occurs when the character bumps into the mesh. When the mesh bumps into the character, a collision does not occur -- the mesh just passes through the character.
I'm aware that this asymmetry exists because of how character controllers are implemented. I've seen a few solutions for these types of issues posted, but all of them involve simple platforms, not arbitrary meshses. If I need my character to be knocked around by an object with a mesh collider, do I have any good alternatives other than making my character a rigidbody and recoding a lot of its controls?
Note: the large mesh in question will always be a child of another character controller, if that helps.
You mean add a character controller to the mesh? That would be nice, except for the fact that character controllers seem to come with capsule colliders built in (and I need the meshes to retain their mesh colliders).
Note: for others out there who encounter similar problems, I've managed to make things work decently well by swapping out my character controller for something I adapted from the following script: http://www.unifycommunity.com/wiki/index.php?title=RigidbodyFPSWalker
It would be nice if there was an easy way to enable character controllers to collide with a certain subset of game objects, though, 'cause rigidbody physics is a lot rougher.
I mean to add similar collision code to the mesh. Since the mesh has a collider, you can call its collision event when something collides with it, and have the same events happen in that collision event.