Hi!
I made a main menu and I need a script to turn off blur once an input is given with the button UI For a 2D game!
Thanks!
Hi!
I made a main menu and I need a script to turn off blur once an input is given with the button UI For a 2D game!
Thanks!
With the blur script in another camera
I’m assuming you’re using the Blur script that comes with the free Effects package?
If so, you must first include this line at the top of another script in order to access it:
using UnityStandardAssets.ImageEffects;
Afterwards, you can do something like this to toggle it on and off:
public Blur blurEffect; // Drag the blurred camera to this slot in the Inspector
void Update ()
{
// Toggles blur effect
if (Input.GetKeyDown(KeyCode.Space))
blurEffect.enabled = !blurEffect.enabled;
}
Instead of having a public Blur variable, you could also of course just do
GetComponent<Blur>()
.
Hopefully this will steer you in the right direction!