I've already tried using GetParent().GetNodeOrNull<Position2D>("Position2D")
, but when I try to use Position
or GlobalPosition
I get this error:
E 0:00:01.635 void Player.Fire(): System.NullReferenceException:
Object reference not set to an instance of an object. <C++ Error>
Unhandled exception <C++ source>
C:\Users\dulou\OneDrive\Documents\Game 001\Body\Player.cs:20 @ void
Player.Fire()() Player.cs:20 @ void Player.Fire()()
Player.cs:44 @ void Player._PhysicsProcess(Single )()
and this keeps happening in any kind of function or method