Boss defeat error

Godot Version

4.3

Question

Im trying to make it so when my boss is defeated, the wall disappears and a particle effect plays. But when it happens I get this error.

level_4.gd:5 @ _process(): Node not found: “Boss” (relative to “/root/level_4”).

Idk if I’m using is_queued_for_deletion right, but I couldn’t find an example of how to use it.

extends Node2D


func _process(_delta: float) -> void:
	if $Boss.is_queued_for_deletion() == true:
		$midground2.enabled = false #wall being deleted
        #particles
		$explosion.emitting = true 
		$explosion2.emitting = true

I found a solution, instead of seeing if the boss was queued, I just called the level_4 script from the boss script when the boss was considered dead.