this script compile but dont work in the game so when i press F the blur effect dontt works
i tryed to disable in the start method it works bur when i press F it dont works
if someone can help me solving this !!!
using UnityEngine;
using UnityEngine.UI;
using UnityStandardAssets.ImageEffects;
public class read_sheet : MonoBehaviour {
public Image photo;
public Camera fpscam;
public float range =2;
public Blur blureffect;
void Start()
{
//fpscam.GetComponents<Blur>() ;
// blureffect.enabled = false;
}
void Update () {
RaycastHit hitinfo;
if (Physics.Raycast (fpscam.transform.position, fpscam.transform.forward, out hitinfo, range))
{
if ((hitinfo.transform.name == "sheet1"))
{
if (Input.GetKeyDown(KeyCode.F)) {
photo.gameObject.SetActive(true);
blureffect.enabled = true;
}
}
else
photo.gameObject.SetActive(false);
blureffect.enabled = false;
}
}
}