- Home /
I can't figure out how to enable / disable a trigger.
Is this the right line of code to use? Everything else is set up correctly, but this line of code will not work. Thanks.
Collider1.GetComponent(BoxCollider).isTrigger = false;
Answer by Random username · Oct 04, 2012 at 11:31 AM
All you need to do is: Collider1.collider.isTrigger = false;
I tried it, and it is not working. Collider1 is a gameobject that I chose the editor.
Ill give you the whole script in the morning. Its just not working.
Answer by hoffmanuel · Oct 04, 2012 at 12:20 PM
what is Collider1? is that already of type Collider? if so, you don't need the GetComponent.
than
Collider1.isTrigger = value;
would be correct
Even though it is a gameobject that I select? Is the method I used Only for scripts?
Your answer
Follow this Question
Related Questions
How to do Multiple OnTriggerEnters 2 Answers
Boolean problem!! 2 Answers
Can't click gameobject when over another trigger? 1 Answer
The public bool will not change unless i set it 1 Answer
Triggering platform animation on colliding with Button 0 Answers