Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Lboy · Jun 07, 2012 at 04:47 AM · errorerror messagemissingreferenceexceptionparticleemitter

Particle Emitter error, Missing reference exception.

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 ; } }

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image hijinxbassist · Jun 07, 2012 at 05:24 AM 1
Share

Remove the =null part of the declarations.

avatar image Lboy · Jun 07, 2012 at 07:38 AM 0
Share

thanks hijinx

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by rutter · Jun 07, 2012 at 07:16 AM

I would try hijinxbassist's suggestion.

If that doesn't work, make sure that you've set the references up in the inspector. If any of them are listed as "None", they're not pointing at anything.

Finally, you might want to check if the ParticleEmitter has AutoDestruct set -- if so, it will self-destroy once the emitter has finished. After that happens, subsequent attempts to access to emitter can produce errors.

If push comes to shove, you could always check for null before using the reference. It might allow you to figure out exactly when things are going wrong, if you log a message once that happens.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Lboy · Jun 07, 2012 at 07:37 AM 0
Share

i tried hijinx's method, didnt work but then i turned off the automatic emit on the waterfall and it worked for some reason. i did leave =null out by the way

thanks for the help guys.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Casting error on multiple emitters 3 Answers

What is happening and what does this MEAN!?!?!?!?!?!?!?!? AHHHHH!!!!,WHAT IS HAPPENING?!?! 1 Answer

Too many errors in the IDE (even for a fresh project), but editor doesn't throw any errors! 1 Answer

GameManager trying to access method from deleted GameManager via the InvokeRepeating() function 0 Answers

Unity Error: Only assignment, call, increment, decrement, and new object expressions can be used as a statement 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges