Replies: 1 comment
-
This is considered a bug: godotengine/godot#19068 However, for the purposes of UI animation, a dedicated feature that only affects rendering may be more suited: godotengine/godot#87081 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When you place a control node as a child of any container, the child's transform properties are grayed out by design making the parent container be solely responsible.
One might assume that this would be the case in code too, however it seems that you are able to set these properties through code. For example, this code on a container child will set it's position every frame:
The same can be done with any other transform property. To my knowledge, this behaviour is not documented anywhere. Is this something that has slipped through or by design? To me it seems like it is a mistake since there seems to be another inconsistency when setting these 'locked' properties through code:
If you were to try to set any of these properties in
_ready()
, you'll find that you can only set thepivot_offset
property. Attempting to set any other property seems to not have any effect. I assume this has something to do with how the node/property is initialized, because this can be worked around by awaiting one frame before setting the properties:It would be great to see this behaviour be consistent and documented. Additionally, a system for a container child to deviate from the position decided by the parent container would make creating UI animations a lot more straightforward. At the moment this is possible by managing the 'home' position manually and setting transform properties through code as described above, or by the common workaround for introducing an intermediate control node into the container and childing the original child to it, but these methods are iffy and make working with something seemingly straightforward more annoying.
Beta Was this translation helpful? Give feedback.
All reactions