- Home /
Unable to access Blur
I'm trying to make a gradual blur when player presses a button. What is the best way to do this?
Currently, I'm adding the blur effect to the main camera at the beginning but disable it, and when the player presses the button I downsample the image and Lerp the blur radius.
How do I access the Blur component from my GUI script though? Since BlurEffect is deprecated, I try to use
blur = GetComponent<Blur>();
But it tells me Blur isn't a class and stuff, and BlurEffect, the deprecated class, is...
I have got the same problem. It is because the Blur Effect is Javascript, and you are probably try to accessing it in a C# script. Here is my question with the Converted scripts to C#: http://answers.unity3d.com/questions/680942/change-blur-effect-at-runtime.html
Answer by magic9cube · Mar 27, 2015 at 01:22 AM
I had a similar problem. Blur could not be found for me until i included the correct reference;
using UnityStandardAssets.ImageEffects;
How did I forget that ? I was trying to use the blur, but forgot to add the library thanks friend rsrs
Answer by IdiotsCode · Dec 26, 2015 at 11:20 AM
private var mBlur : UnityStandardAssets.ImageEffects.MotionBlur;
function Start()
{
mBlur = GameObject.Find("Main Camera").GetComponent(UnityStandardAssets.ImageEffects.MotionBlur);
mBlur.enabled = false;
}
This is what I tend to use. :D hope I helped!
Your answer
Follow this Question
Related Questions
lerp blur effect unity pro 2 Answers
Can I blur only part of the objects on my scene? 1 Answer
Importing from photoshop, Images lose definition. 0 Answers
How to blur an image in memory? 1 Answer
How do the camera motion blur exclude layers work? 2 Answers