Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | CarlitosCUeba |
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
How is your scene setup?
magicalogic | 2021-06-09 05:39
is basically:
Player(KinematicBody2D)
—Sprite
—CollisionShape2D
—Position2D
CarlitosCUeba | 2021-06-10 00:31