I’m in 2D. I have a character controller on my playable character. He’s moving great, however the character controller will not collide with anything under any circumstances (I’m using boxcollider2d on environment objects). It seems like the character controller, which purportedly comes with a collider built-in, shouldn’t move straight through walls - or am I REALLY missing something about how this thing is supposed to work?
The docs say the character controller doesn’t need a rigidbody (that’s the point of having a CC isn’t it?) and doesn’t need a collider added to it. In fact, Unity won’t let me add a collider or rigidbody to a gameObject with a character controller.
Things I’ve tried:
-
Toggling off “Is Trigger” on my collider object (and no, there is no such setting on character controller)
-
Adding a rigidbody2D to a child
-
Adding a boxcollider2D to a child
-
Using OnControllerColliderHit to write my own “don’t walk through stuff” code (it never fires)
-
Adding rigidbody2D to everything in the environment (they all just fell off the screen - and they went straight through my player on the way without touching him, so turning gravity off is irrelevant).
-
Tearing my hair out.