Alright, so essentially, I have an "orb" as a child of my player. I have two Position2D children of my player, labelled "rpos" and "lpos". When the cursor is to the right of the character, I want the orb to be in the position of rpos, and when the cursor is to the left of my character, I want the orb to be in the position of lpos. Here is my code:
mpos = get_viewport().get_mouse_position()
if mpos.x >= 0:
position = get_parent().get_node("r_pos").position
if mpos.x < 0:
position = get_parent().get_node("l_pos").position
For some reason, no matter where the mouse is, the orb is always in the position of r_pos. Could someone help me?