I am making a 2D platformer game in Godot, I create an object using the code:
if currentPlayers < playerLimit:
var person = humanScene.instance()
add_child(person)
person.position = Vector2(90, 300)
currentPlayers += 1
print(person.position)
This works well, but in the "_physics_process(delta):" function, if i try doing:
"print(person.position)"
it says:
"Invalid get index 'position' (on base: 'null instance')"
No matter what I try, my code can't seem to find the instanced object to find its position (i need its position every frame). Is there a special way to access instanced objects data (such as their positions?) thank you in advance!