- Home /
Question is off-topic or not relevant
Can a character controller collide with a trigger?
I have a player that uses a character controller and a box collider that has is trigger selected. I want it so when the player hits the box collider, it moves the camera. However, this does not seem to be working at all. Is it even possible for a character controller to collide with a trigger, and if so, is there any specific way I would go about doing this?
I have a character, with CharacterController and it collides with trigger without any problem. Don't know why you woud have a problem with that... $$anonymous$$aybe the problem is somewhere else.. Layer?
Can you show some piece of code?
Sorry, it seems I had a completely unrelated problem. Turns out you can't do input in the OnTriggerEnter function. Derp.
Answer by Ares121 · Jun 27, 2014 at 09:49 PM
I'm fairly new with Unity but I've been messing with triggers a bit as of late. If you want a reaction upon collision you would need to use a function like OnCollisionEnter. If you are using a trigger it will not collide with the trigger collider, but it will tell the code to behave however you have told it to with the function OnTriggerEnter. Perhaps if you post some of your code one of the pros can provide a more detailed answer for you.
Answer by MrReynevan2 · Jun 27, 2014 at 09:49 PM
Generally, triggers are used to trigger something, not to check for collisions. If you're looking for simple way to fix your problem, try making empty GameObject, and set it as child of obiect with box collider.
For the parent, set "Is Trigger". For the child (recently created gameobject) add "Box Collider", and set i about the size of the parent's colider. Don't check "Is Trigger". This way you'll be able to both trigger actions, and check for collisions. It's simple, not perfect though.