Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
1
Question by PreFleet12500 · Apr 01, 2020 at 09:20 AM · errorerror messagenullreferenceexceptionnullreference

Unexplanable NullReferenceException Error

I am trying to make a 2D platformer and it is all working fine for now. However, I came across this random and mysterious error where I can't figure it out. Could someone explain to me why I have it and where is it causing it. I can't show the code since the error does not give the location. Here is the error:


NullReferenceException: Object reference not set to an instance of an object UnityEditor.Graphs.Edge.WakeUp () (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/Edge.cs:114) UnityEditor.Graphs.Graph.DoWakeUpEdges (System.Collections.Generic.List`1[T] inEdges, System.Collections.Generic.List`1[T] ok, System.Collections.Generic.List`1[T] error, System.Boolean inEdgesUsedToBeValid) (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/Graph.cs:387) UnityEditor.Graphs.Graph.WakeUpEdges (System.Boolean clearSlotEdges) (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/Graph.cs:286) UnityEditor.Graphs.Graph.WakeUp (System.Boolean force) (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/Graph.cs:272) UnityEditor.Graphs.Graph.WakeUp () (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/Graph.cs:250) UnityEditor.Graphs.Graph.OnEnable () (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/Graph.cs:245)


Comment
Add comment
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

2 Replies

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

Answer by julianjulianov · Feb 27, 2021 at 09:40 AM

Hello! I also came across this problem and it was actually a serious problem. In the game menu I have the option to remove all sound effects via "Toggle". I have set a script for each new level to create one cloned enemy in more. In another script I store the data whether the sound effects in the game are on or off. I noticed that the cloned enemies still have a sound when "Toggle" is off, and I solved my problem like this:

 using UnityEngine.UI;
 using UnityEngine;
   
 public class SoundEffectSaver: MonoBehavior
 {
  public Toggle toggleAudioChecker;
  public Enemy [] _enemies;
  public Crate [] _crates;


 public void Start ()
 {
     toggleAudioChecker.isOn = PlayerPrefs.GetInt ("SaveBoolAudio")! = 0;
 }

 public void Update ()
 {
     _enemies = FindObjectsOfType <Enemy> ();
     _crates = FindObjectsOfType <Crate> ();
     PlayerPrefs.SetInt ("SaveBoolAudio", toggleAudioChecker.isOn? 1: 0);
     int value;
     value = toggleAudioChecker.isOn? 1: 0;
     if (value == 1)
     {
         toggleAudioChecker.isOn = true;
         GameObject.Find ("FlyFairy"). GetComponent <AudioSource> () .enabled = true;

         foreach (Enemy enemy in _enemies)
         {
             enemy.GetComponent <AudioSource> () .enabled = true;
         }

         foreach (Crate crate in _crates)
         {
             crate.GetComponent <AudioSource> () .enabled = true;
         }
     }
     else
     {
         toggleAudioChecker.isOn = false;
         GameObject.Find ("FlyFairy"). GetComponent <AudioSource> () .enabled = false;

         foreach (Enemy enemy in _enemies)
         {
             enemy.GetComponent <AudioSource> () .enabled = false;
         }

         foreach (Crate crate in _crates)
         {
             crate.GetComponent <AudioSource> () .enabled = false;
         }
     }
 }

}

The original version was this:

 using UnityEngine.UI;
 using UnityEngine;
 using UnityEngine.SceneManagement;

 public class SoundEffectSaver: MonoBehavior
 {
  public Toggle toggleAudioChecker;

  public void Start ()
  {
      toggleAudioChecker.isOn = PlayerPrefs.GetInt ("SaveBoolAudio")! = 0;
  }

  public void Update ()
  {
     PlayerPrefs.SetInt ("SaveBoolAudio", toggleAudioChecker.isOn? 1: 0);
     int value;
     value = toggleAudioChecker.isOn? 1: 0;
     if (value == 1)
     {
         toggleAudioChecker.isOn = true;
         GameObject.Find ("FlyFairy"). GetComponent <AudioSource> () .enabled = true;

         if (SceneManager.GetActiveScene (). buildIndex> = 0 && GameObject.Find ("Monster") == true)
         {
             GameObject.Find ("Monster"). GetComponent <AudioSource> () .enabled = true;
         }
         if (SceneManager.GetActiveScene (). buildIndex> = 1 && GameObject.Find ("Monster (1)") == true)
         {
             GameObject.Find ("Monster (1)"). GetComponent <AudioSource> () .enabled = true;
         }
         if (SceneManager.GetActiveScene (). buildIndex> = 2 && GameObject.Find ("Monster (2)") == true)
         {
             GameObject.Find ("Monster (2)"). GetComponent <AudioSource> () .enabled = true;
         }
         if (SceneManager.GetActiveScene (). buildIndex> = 3 && GameObject.Find ("Monster (3)") == true)
         {
             GameObject.Find ("Monster (3)"). GetComponent <AudioSource> () .enabled = true;
         }
         if (SceneManager.GetActiveScene (). buildIndex> = 4 && GameObject.Find ("Monster (4)") == true)
         {
             GameObject.Find ("Monster (4)"). GetComponent <AudioSource> () .enabled = true;
             GameObject.Find ("Crate (8)"). GetComponent <AudioSource> () .enabled = true;
             GameObject.Find ("Crate (9)"). GetComponent <AudioSource> () .enabled = true;
             GameObject.Find ("Crate (10)"). GetComponent <AudioSource> () .enabled = true;
             GameObject.Find ("Crate (11)"). GetComponent <AudioSource> () .enabled = true;
             GameObject.Find ("Crate (12)"). GetComponent <AudioSource> () .enabled = true;
             GameObject.Find ("Crate (13)"). GetComponent <AudioSource> () .enabled = true;
             GameObject.Find ("Crate (14)"). GetComponent <AudioSource> () .enabled = true;
             GameObject.Find ("Crate (15)"). GetComponent <AudioSource> () .enabled = true;
             GameObject.Find ("Crate (16)"). GetComponent <AudioSource> () .enabled = true;
             GameObject.Find ("Crate (17)"). GetComponent <AudioSource> () .enabled = true;
             GameObject.Find ("Crate (18)"). GetComponent <AudioSource> () .enabled = true;
             GameObject.Find ("Crate (19)"). GetComponent <AudioSource> () .enabled = true;
             GameObject.Find ("Crate (20)"). GetComponent <AudioSource> () .enabled = true;
             GameObject.Find ("Crate (21)"). GetComponent <AudioSource> () .enabled = true;
             GameObject.Find("Crate (22)").GetComponent<AudioSource>().enabled = true;
             GameObject.Find("Crate (23)").GetComponent<AudioSource>().enabled = true;
             GameObject.Find("Crate (24)").GetComponent<AudioSource>().enabled = true;
         }
         if (SceneManager.GetActiveScene().buildIndex >= 5 && GameObject.Find("Monster (5)") == true)
         {
             GameObject.Find("Monster (5)").GetComponent<AudioSource>().enabled = true;
             GameObject.Find("Crate (8)").GetComponent<AudioSource>().enabled = true;
             GameObject.Find("Crate (9)").GetComponent<AudioSource>().enabled = true;
             GameObject.Find("Crate (10)").GetComponent<AudioSource>().enabled = true;
             GameObject.Find("Crate (11)").GetComponent<AudioSource>().enabled = true;
             GameObject.Find("Crate (12)").GetComponent<AudioSource>().enabled = true;
             GameObject.Find("Crate (13)").GetComponent<AudioSource>().enabled = true;
             GameObject.Find("Crate (14)").GetComponent<AudioSource>().enabled = true;
             GameObject.Find("Crate (15)").GetComponent<AudioSource>().enabled = true;
             GameObject.Find("Crate (16)").GetComponent<AudioSource>().enabled = true;
             GameObject.Find("Crate (17)").GetComponent<AudioSource>().enabled = true;
             GameObject.Find("Crate (18)").GetComponent<AudioSource>().enabled = true;
             GameObject.Find("Crate (19)").GetComponent<AudioSource>().enabled = true;
             GameObject.Find("Crate (20)").GetComponent<AudioSource>().enabled = true;
             GameObject.Find("Crate (21)").GetComponent<AudioSource>().enabled = true;
             GameObject.Find("Crate (22)").GetComponent<AudioSource>().enabled = true;
             GameObject.Find("Crate (23)").GetComponent<AudioSource>().enabled = true;
             GameObject.Find("Crate (24)").GetComponent<AudioSource>().enabled = true;
             GameObject.Find("Crate (25)").GetComponent<AudioSource>().enabled = true;
         }

         GameObject.Find("Crate").GetComponent<AudioSource>().enabled = true;
         GameObject.Find("Crate (1)").GetComponent<AudioSource>().enabled = true;
         GameObject.Find("Crate (2)").GetComponent<AudioSource>().enabled = true;
         GameObject.Find("Crate (3)").GetComponent<AudioSource>().enabled = true;
         GameObject.Find("Crate (4)").GetComponent<AudioSource>().enabled = true;
         GameObject.Find("Crate (5)").GetComponent<AudioSource>().enabled = true;
         GameObject.Find("Crate (6)").GetComponent<AudioSource>().enabled = true;
         GameObject.Find("Crate (7)").GetComponent<AudioSource>().enabled = true;
     }
     else
     {
         toggleAudioChecker.isOn = false;
     }
 }

}

Comment
Add comment · Show 2 · 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 Bunny83 · Feb 27, 2021 at 11:23 AM 0
Share

You came across "this" problem? How is your problem related to a null reference exception in Unity's internal editor Graph and Edge class? This doesn't seem to answer the question at all. You know this is a Q&A site, not a forum? The forum is over here, however I'm not sure your post would actually help anyone as your original code is horrible program$$anonymous$$g style and depends on countless hardcoded object names which is most likely the root cause of all your problems you may have had.

avatar image julianjulianov · Feb 28, 2021 at 07:51 AM 0
Share

Hello! I am convinced that it will help many beginners like me. They should not put up with any problem, but look for a way to solve it. I succeeded and this annoying message no longer appears.

avatar image
1

Answer by Kaldrin · Nov 11, 2020 at 07:56 PM

This seems to be an error inside of unity's assets You can't do anything about it but it shouldn't prevent the game from running fine.

Comment
Add comment · 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

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

170 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Moving a character to a waypoint 1 Answer

"Assertion failed: Error querying default thread scheduling params: 3" 0 Answers

NullReferenceException - Why? 2 Answers

im getting this error: NullReferenceException: Object reference not set to an instance of an object Item.Start () (at Assets/Scripts/Inventory System/Item.js:9) 1 Answer

NullReferenceException on empty project because of ScriptCompilerBase 0 Answers


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