- Home /
 
 
               Question by 
               Mihaaa_123_123 · Aug 09, 2015 at 11:44 AM · 
                unity 5cameratriggercomponentimage effects  
              
 
              Enabeling components
Hi, I have a game in Unity 5. I want to enable Motion Blur component on player's camera when player enters trigger. I cannot find anything on Google that works, so I am asking for help. script:
 piblic GameObject trigger;
 
 void OnTriggerEnter()
 { 
 If(trigger.tag==trigger){
 'Enable Motion blur
 }
 }
 
               Thanks!
               Comment
              
 
               
              Answer by allenallenallen · Aug 09, 2015 at 11:55 AM
https://unity3d.com/learn/tutorials/modules/beginner/scripting/enabling-disabling-components
Also, you misspelled public. And you can't test a tag equal a GameObject.
 public MotionBlur motionBlur; // Drag the Camera in the hierarchy to the inspector.
 void OnTriggerEnter(Collider other){
     if (other.tag == ???){
         motionBlur.enabled = true;
     }
 }
 
              Your answer
 
             Follow this Question
Related Questions
Fade/smooth out image effects? 0 Answers
How to change camera on trigger enter unity 5 1 Answer
Disable components in runtime per quality setting ? 1 Answer
Trigger Camera Effect 0 Answers