- Home /
Question by
NateBestDevRocks · Aug 25, 2015 at 11:51 AM ·
scripting problemoncollisionenterdisable object
How to disable blur image effect on collision
Hi. I made a scene in Unity where the player is in a cave and I want it so when he walks out the camera blur effect turns off. I put an empty gameobject so he will walk into that, but I don't have a script to turn off the Blur script. Thanks!
Comment
Answer by NeverHopeless · Aug 25, 2015 at 11:53 AM
You can find the game object and set either the gameobject inactive or simply disable the script.
Try like this:
GameObject.Find("BlurEffectGameObject").SetActive(false);
Or:
GameObject.Find("BlurEffectGameObject").GetComponent<BlurEffectScript>().enabled = false;
Use OnCollisionEnter
event for this.
Your answer
