|Attention||Topic was automatically imported from the old Question2Answer platform.|
I have the following situation: I have a custom node with a script attached to it, which defines certain exported values, so they are editable inside the editor UI.
Those variables have a setter function which in turn changes certain other values on the same node.
When I edit the values in the editor UI (under “Script Variables”) in the “prefab” (custom node) itself, it does update the values I change in code on another object on the same node (shader uniform parameter) as well. But when I instance the given custom node in another scene, and edit the values in the editor UI again, the values of the variables in the script do change, but it doesn’t update the other values (shader param’s) on the same node, like it does, when I change the values in the custom node (not instanced) itself.
Is that a “bug”, or is that intentionally?
For a better understanding, here are some screenshots and code snippets, to better showcase what I mean:
Code snippet for both cases the same:
... export (Vector2) var texture_scale = Vector2(1, 1) setget _set_texture_scale ... func _set_texture_scale(value): texture_scale = value self.material.set_shader_param("uv_scale", Vector3(texture_scale.x, texture_scale.y, 0)) ...
When I edit the values in the custom node itself (not instanced in another scene)
When I edit the values on an instanced node of the custom node (with editable children activated)
I hope you can help me understanding, why that shouldn’t just work the same as the first one. Or if there is a better way, to handle those situations. Thank you very much in advance. I hope you all have a stress-free sunday.