extends Node2D onready var player = get_parent().get_node("Player") # Declare member variables here. Examples: # var a = 2 # var b = "text" # Called when the node enters the scene tree for the first time. func _ready(): var covers = get_node("../Covers") covers.show() # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta): for i in range(5): var room = get_child(i) var furniture = get_node("../Furniture").get_child(i) var cover = get_node("../Covers").get_child(i) if(room.overlaps_body(player)): furniture.show() cover.hide() else: furniture.hide() cover.show()