Global property variable #5186
Lasthy
started this conversation in
Engine Core
Replies: 2 comments 1 reply
-
Export a variable on parent node (this lets you "preview in editor"), access it from children, done. |
Beta Was this translation helpful? Give feedback.
1 reply
-
When its about to have "global" values as you describe it, 2 options that I'm aware of:
An additional option would be use custom resources, but its better to research before its caveats. To execute code in-editor use tool scripts; put |
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
Uh oh!
There was an error while loading. Please reload this page.
-
The idea would be to be able to create variables, like shader globals, that could be used across multiple nodes, and modified like, for example:
I could make a Node2D, place a bunch of children nodes, put a global property variable (let's call it global_angle) on the Node2D rotation_degrees, and to it's children, we could place on the rotation_degrees the value of -global_angle.
Then, when we rotate Node2D with the rotation_degrees, the children would rotate in the other way, and would keep it's relative angle to the player/dev.
I know this can be achieved by code, but it isn't able to preview on editor.
If someone knows if it is possible to do it already on version 3.x I would be grateful if you shared with me.
Beta Was this translation helpful? Give feedback.
All reactions