Godot Version
v4.7.1.stable.official
Question
I have some component classes that require specific child nodes to work, but i’m unsure on how to handle the absence of these child nodes. Should i construct them, take them from a scene, or something else?
If you need them then you should make them. Are you asking how to handle the error of a missing yet expected child node? If so, don’t! let the error tell you when there is a problem and fix the problem, if anything make it an assert so you can produce more errors earlier.
func _ready() -> void:
assert(has_node("ImportantChildName"), "Missing important Child!")
Oh, whoops. I should’ve specified that it would like, handle it itself…
Actually looking at that idea now, it seems unneeded (at least currently). Thanks for the help anyway!