|Topic was automatically imported from the old Question2Answer platform.
Is it considered bad practice to tweak instanced scenes’ child nodes via checking the “Editable Children” option of the root node? Or should I be exposing and “passing up” variables that the children use to their parents so all the configurable vars are accessible from the root node? Or something else entirely?
The first option seems cleaner to me, but considering the “editable children” are greyed out, it almost seems like a debug option, or one that should be used sparingly.
Here’s the scenario I’m working with as an example:
I made a super basic boost zone that accelerates a rigidbody2D as an exercise:
The above picture is the main scene tree with one instance of the boost zone in use. The BoostZone has the “Editable Children” property checked, accessible by right-clicking on its node. The boost zone uses another simple scene called “ScrollingSprite” that, as the name suggests, scrolls a texture in a direction configurable by two exported vars:
Note how, in the first image, ScrollingSpriteV2’s child animation node, “AnimationPlayer”, is not visible, as I have not checked ScrollingSpriteV2’s “Editable Children” property.
I want to make the boost zone easily configurable so I can have multiple zones with different colors, different sprites, or different speeds/directions at whim. But in order to affect the sprite and its scrolling direction, I need to access the ScrollingSpriteV2 child of the BoostZone parent. I’m coming from a Unity background where, to solve this, I’d have a script component that scrolls the required Image sprite component attached to the GameObject. Then I’d have a separate script on the same GameObject that handles the acceleration of any entering object.
Is checking “Editable Children” the best way to do this? Should I be saving multiple slight variants of the same scene? Should I keep the ScrollingSprite and Area2D that detects RigidBody2Ds as separate scenes entirely and manually place them and line them up in my Main scene? Is there a cleaner way that’s more standard-practice?
Thanks in advance.