diff --git a/addons/block_code/block_code_node/block_code.gd b/addons/block_code/block_code_node/block_code.gd index 8c2b867f..fc03f04f 100644 --- a/addons/block_code/block_code_node/block_code.gd +++ b/addons/block_code/block_code_node/block_code.gd @@ -67,6 +67,12 @@ func _update_parent_script(): func _get_configuration_warnings(): var warnings = [] + if self.owner == null: + warnings.append("A BlockCode must not be a root node.") + if get_parent() is BlockCode: + warnings.append("The parent must not be a BlockCode.") + if get_parent().find_children("*", "BlockCode", false).size() > 1: + warnings.append("The parent should only contain one BlockCode.") if block_script and _get_custom_or_native_class(get_parent()) != block_script.script_inherits: var warning = "The parent is not a %s. Create a new BlockCode node and reattach." % block_script.script_inherits warnings.append(warning)