- Home /
How to go through by Charactor Controller?
Hi, I'm new to Unity. I want to make a object can go through other object using Character Controller. (like a "Collider.isTrigger = true")
Can I create that? Please teach me how to set up.
Not sure I understand your question, but if you want an object to ignore collisions, mark the object's collision as trigger in the component properties in the inspector.
First up, stop using CharacterControllers. They're more trouble than they're worth.
Answer by syclamoth · Sep 19, 2011 at 11:26 AM
Use
characterController.detectCollisions = false;
This disables the collider much like collider.isTrigger would.
Answer by Clunk · Sep 19, 2011 at 04:40 AM
Just disable the CharacterController and Colliders temporarily. You can enable and disable by script during certain instances.
GetComponent("CharacterController").enabled = false; GetComponent("CapsuleCollider").enabled = false;
Won't work, assu$$anonymous$$g that Saraska wants to keep using the CharacterController for movement while it is phasing through things (since disabling it will naturally also prevent its movement functions from working). Also, you can't have both a CharacterController component and also a CapsuleCollider at the same time- they are technically both types of colliders and Unity does not allow more than one collider on each gameObject.
Your answer
