Let's assume you have following tree structure:
- Node2D
|---- Sprite1 (Player)
|---- Sprite2 (Tree)
You could create a script in the Node2D node with:
func _process(delta):
if Input.is_action_pressed("ui_down"):
if not $Sprite2.visible:
$Sprite2.visible = true
$Sprite2.position = $Sprite1.position
else:
if $Sprite2.visible:
$Sprite2.visible = false
Since the tree node is after the player node in the node tree, it will be drawn over the player.