0

My project is in 2019.4.21.. When i try to convert to 2021.3.4f1...

When i try to run my project in

2021.3.4f1... It shows the error in Dropdown..

NullReferenceException: Object reference not set to an instance of an object
UnityEngine.UI.Dropdown.AlphaFadeList (System.Single duration, System.Single start, 
System.Single end) (at 
Library/PackageCache/com.unity.ugui@1.0.0/Runtime/UI/Core/Dropdown.cs:1067)
UnityEngine.UI.Dropdown.Show () (at 
Library/PackageCache/com.unity.ugui@1.0.0/Runtime/UI/Core/Dropdown.cs:884)

i have attached the screen shot with this. How can i solve this error.enter image description here

karthik keyan
  • 428
  • 4
  • 14
  • Can you show us the relevant part of your code that throws this error? – Lajos Arpad Jun 14 '22 at 11:22
  • Does this answer your question? [What is a NullReferenceException, and how do I fix it?](https://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it) – Charlieface Jun 14 '22 at 13:22

1 Answers1

0

A null reference exception occurs when you try to access a instant of a object that doesn't exist, meaning that your likely trying to access a part of an object that is equal to null. Looking at your error message, it looks like the error is being thrown from a library in Unity? If that is the case, either there is a problem with that library or more likely your asking the library to use a object that hasn't been instantiated yet so is still null.

Without seeing your scripts, we can't help you find the issue. But your best bet is to go through all the objects in your scripts and ensure that they are instantiated before they are used. Unity has plenty of debugging tools such as Debug.Log(argument) that will print the value of a object to the console log. I suggest you use these tools to check the object AlphaFadeList and similar objects to be sure they aren't null when something is trying to use or access them.

Istalri Skolir
  • 96
  • 1
  • 11