Hi, I have a this error constantly popping up.
MissingReferenceException: The object of type ‘ParticleEmitter’ has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
I have this script on my waterfall, the tag “EditorOnly” is a rock object (with a mesh collider) designed to stop the waterfall from flowing when it conjuction with the waterfalls collider. All the publicemitters are assigned in the inspector. thanks.
using UnityEngine;
using System.Collections;
public class Waterfalltrigger2 : MonoBehaviour {
public ParticleEmitter myBigmist = null;
public ParticleEmitter myEmitter = null;
public ParticleEmitter myWatersplash = null;
public Light Waterpointlight = null;
void OnTriggerEnter(Collider other){ if(other.CompareTag(“EditorOnly”)) myEmitter.emit = false ; myWatersplash.emit = false ; myBigmist.emit = false ; Waterpointlight.intensity = 0 ; }
void OnTriggerExit(Collider other){ if(other.CompareTag(“EditorOnly”)) myEmitter.emit = true ; myWatersplash.emit = true ; myBigmist.emit = true ; Waterpointlight.intensity = 2 ; } }