- Home /
trigger inappropriate activation
Use trigger to activate and to disactivate GUI.Box and GUI.Label when the FPS collides with the trigger. But all gameobject are activating the trigger, as well as the components of the physics. How to make with that only the FPS activates the trigger? I am thankful anticipatedly
Answer by Berenger · Jan 27, 2012 at 11:41 PM
You can either check the tag of the colliding object, or use layers to explicitly say what can collide with your trigger.
http://unity3d.com/support/documentation/ScriptReference/Component-tag.html
http://unity3d.com/support/documentation/Components/Layer%20Based%20Collision%20detection.html
Setting the layers is the best options as it will save unnecessary Physics computation which are never cheap.
Your answer
![](https://koobas.hobune.stream/wayback/20220613063358im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Triggers causes scene to lag 2 Answers
FPS is decreasing when 2 objects collides 2 Answers
Collision vs Trigger [Solved] 5 Answers
onTriggerStay causes massive FPS hit 0 Answers