|Attention||Topic was automatically imported from the old Question2Answer platform.|
I have this tree:
-root --PartidaData --World ---Locations ---Camera
On the singleton PartidaData I have a variable “camerazoom”.
When the Camera zooms (animated with a Tween) it changes the value of that variable.
Locations take that value and gets visble/not visible according to that value.
The problem is that as Camera uses a Tween, Locations execute before it ends so doesn’t work as espected.
I thought about using a custom signal, but it feels hacky.
// use “group” // Groups — Godot Engine (stable) documentation in English
func example(): if $Camera2D.zoom == Vector2(2,3): get_tree().call_group("group_name", "func_name") pass
or Use signal
signal = test
func example(): if $Camera2D.zoom == Vector2(2,3): emit_signal("test") pass
ramazan | 2022-03-22 11:48
Ok will try it later. So I should call the group from the singleton you say?
chantunRey | 2022-03-22 12:38