After getting component its reference is not null if component not exists,
problem at line 34:
if (RootRigidbody == null)
If RigitBody2D not exists it returns object with null reference but not null, if replace it with
if (RootRigidbody.Equals(null))
It will work fine, but I don’t understand this behavior, can you say what I’m doing wrong?
Reference is not null:
But component is missing: