Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | lalel345 |
i drag a node to the position of the mouse but I want that when I stop pressing it it returns to the position it had before this action
This code is incomplete, I can make it return to position (0,0) but if the node was in another position before dragging it
if Input.is_action_pressed("left"):
global_position = get_global_mouse_position()
if Input.is_action_just_released("left"):
print("return_original_position")