Hi Im new to the forum and kinda new to unity I’ve been doing it for about a month but scripting i’ve just begun.
I’m familiar with the basics and I can understand tutorials well but I’m just wondering what does this script error mean?
NullReferenceException: Object reference not set to an instance of an object
CharacterGenerator.DisplayVitals () (at Assets/Scripts/Character Classes/CharacterGenerator.cs:42)
CharacterGenerator.OnGUI () (at Assets/Scripts/Character Classes/CharacterGenerator.cs:23)
That usually happens when you try to access an object before it is properly initialized.
You can add one element at a time to your DisplayVital() function to narrow down which object access failed. For example, you can start with the …For… loop first by removing everything inside leaving an empty for loop to see if an error will be thrown, then add one element at a time till the error hits.
Well I cut out that last line of script in my DisplayVitals() function and it seemed to take away that error i just got a warning
It seems that was causing the problem but i need that line to get the actual value of my Character so basically the numbers that were
supposed to be beside it