extends Node3D func _ready(): Multiplayer.connect("update_map", update) func update(pos, tile_name, neighbors): var instance: Floor match tile_name: "trash": instance = Trash.new() "tomato-crate": instance = CounterBase.new() "cuttingboard": instance = CounterBase.new() "counter": instance = CounterBase.new() "flour-crate": instance = CounterBase.new() "oven": instance = CounterBase.new() "raw-steak-crate": instance = CounterBase.new() "pan": instance = CounterBase.new() "watercooler": instance = CounterBase.new() "sink": instance = CounterBase.new() "dirty-plate-crate": instance = CounterBase.new() "wall": instance = Wall.new() "chair": instance = Chair.new() "table": instance = Table.new() "floor": instance = Floor.new() "window": instance = Wall.new() "door": instance = Wall.new() _: instance = Floor.new() var node_name = str(pos) if has_node(node_name): queue_free_rename(get_node(node_name)) instance.setup(node_name, neighbors) instance.position = Vector3(pos[0], 0, pos[1]) add_child(instance) func queue_free_rename(node: Node) -> void: node.name += "_queued_free" node.queue_free()