Skip to content

Commit 3fe993f

Browse files
committed
blocks: Add remove node block
When spawning nodes with SimpleSpawner, you likely need a way to delete the node eventually. While you can call queue_free on a node using the call_method_node block, it's nicer to hide the queue_free detail behind a block.
1 parent 093f362 commit 3fe993f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://d31lkxkm5lww7"]
2+
3+
[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_75fle"]
4+
5+
[resource]
6+
script = ExtResource("1_75fle")
7+
name = &"queue_free_node"
8+
target_node_class = ""
9+
description = "Queues the given node to be deleted at the end of the current frame"
10+
category = "Lifecycle"
11+
type = 2
12+
variant_type = 0
13+
display_template = "remove {node: OBJECT}"
14+
code_template = "{node}.queue_free()"
15+
defaults = {}
16+
signal_name = ""
17+
scope = ""

0 commit comments

Comments
 (0)