- Home /
Character controllers and box colliders
I have a model I made out of boxes, and its animated with rotation, and I have a character controller, I want the character controller for my movement, and the box colliders for my collisions for getting shot at, how can I make this work? currently the model, when moving will only go up, and will stay up as if its standing on it. any help?
thanks
Answer by aldonaletto · Jan 05, 2012 at 02:04 AM
The CharacterController has a bug that disturbs its movement when any child collider is touching the character capsule. If you just want to detect collisions in certain parts, change these colliders to triggers and use OnTriggerEnter instead of OnCollisionEnter - triggers don't "wake up" the bug.
does the capsule collide with other objects like a bullet? or will a bullet pass through it?
The CharacterController has a capsule collider that works like any other collider: rockets, bullets etc. that hit it are deflected or stopped, and generate OnCollision events (only if the rigidbody hits the character - not the other way around)
thanks! kinda sucks that for doom style movment you cant have a figure like collider thou
There's nothing stopping you from writing your own 'doom-like' movement controller- just because the inbuilt 'Character Controller' component is annoying to use doesn't mean that you can't do what you're trying to do here!
You can use the box colliders as you was planning: just change them to triggers and use OnTriggerEnter ins$$anonymous$$d of OnColliderEnter - the projectile will be destroyed anyway in the event, thus it doesn't make any difference.