.enabled problem
It kept bothering me saying that the unityengine does not have a definition for "enabled". I have no clue what I am doing wrong. I even tried this in same JS but I got the same problem. Anyway, here is my line of code. I downloaded a motion blur asset pack and the scipt component is called Motion.cs that I added to the FPS controller camera.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Sanity : MonoBehaviour
{
private Motion mBlur;
void Start()
{
mBlur = GameObject.FindGameObjectWithTag( "MainCamera" ).GetComponent<Motion>();
}
void OnTriggerEnter(Collider other)
{
if (other.CompareTag( "Player" ))
{
mBlur.enabled = true;
}
}
void OnTriggerExit(Collider other)
{
if (other.CompareTag( "Player" ))
{
mBlur.enabled = false;
}
}
}
Comment
hi; does "mBlur" script has a Start() method inside it ?
Your answer
![](https://koobas.hobune.stream/wayback/20220612134610im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unity Particle Trigger detection 0 Answers
Confusion Status Effect 0 Answers
How can i disable/enable slowly the blur effect using the blur script ? 0 Answers