- Edited
I'm trying to create a control that contains another control that I've created. I'm running into the problem that when I do this the child component is no longer able to access its child components. They all return null.
For example, I have a component called NumericLineEdit
extends HBoxContainer
class_name NumericLineEdit
@export var value:float:
get:
return value
set(v):
if value == v:
return
value = v
dirty = true
var dirty:bool = true
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if dirty:
$TextEdit.text = str(value)
dirty = false
func _on_text_edit_text_set():
value = float($TextEdit.text)
If I run this alone, it works fine. But if I try to include it in another component, I get a bunch of errors about $TextEdit being null. I've tried using the % notation and also calling get_node(), but it's always null when I try to run a scene that uses it as a child.