So listen, I have an enemy "CharacterBody2D" node in one scene,
And I have a player "CharacterBody2D" node in another scene,
They are both children of the root node in my main scene,
My player has a child Node2D named "PlayerTop", placed above the player
I just want to know how to use gdscript to move my enemy's position to the "PlayerTop".
To sound less confusing, I just want to know how to move one node to the position of another node. Y'know, point A to point B. I feel like it should be the easiest thing in the world, yet nobody on the internet can explain it to me.
In my enemy's script, I defined the node path like:
@onready var player = get_node("/root/Main/node_wanted/child_node_wanted).global_position
And later on in that same enemy's script, when a certain condition is met, I said:
self.position = player
And then It resets my player at the position it started in when the game started running, with my enemy underneath it.
Anyway, BOTTOM LINE:
I just want to move a node to the position of a different node (or it's child). Am I going about this wrong??