Making an instance of a serialized script and showing null, but I take a peak and it's not null

Any idea what’s up with this?

I have [SerializeField] PlayerClass playerClass;

Then…

(Imgur: The magic of the Internet)

What’s up with this showing null, but it isn’t null?

what type is PlayerClass? Is it a System.Object? or does it derive from Monobehavior?

1 Like

This.

Unity does a weird fake null to link between the C# side and the C++ side. So a UnityObject may be functionally null (ie the C++ object no longer exists) but it’s not actually null in C# land yet.

That’s why there is the bool operator for this purpose.

It’s a script : monobehavior