Trying to pass the object reference and set it in the new script/class. Player.cs
How do i go about referencing correctly, and assigning
Trying to pass the object reference and set it in the new script/class. Player.cs
How do i go about referencing correctly, and assigning
I believe this is one of those nasty instances of a NullPointer exception being able to refer to multiple problems. It only gives you the line number, but it doesn't give you which reference in that line was null. NewPlayer isn't null, AchievementList is. You need to initialize that value either earlier in the ShowUI method or in the PanelUpdate constructor.
P.S. I HATE the non-specificity of null reference exceptions; very frustrating.
Your PlayerDetails object has a null property in it. Check the properties on the NewPlayer object in debug mode and you will see this.
Even if you use a new Constructor on it it doesn't mean the property will be given a value unless it's specifically given one within the constructor.
You also need to show the code for the PlayerDetails class to give us a better idea.
Also:
PlayerDetails Player = new PlayerDetails(); // Assigning a new value here means nothing
Player = NewPlayer;
You're creating a new PlayerDetails object on line #1 but then assign it a different value on line #2.
PlayerDetails Player = NewPlayer;
Is fine.