I cannot seem to reference a particular scene from a group of scenes?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By CDHouston7270

I have five instances of a PlayerStats scene in my game, each of them having several HUD elements and animation players in them. Anytime I try to reference one HUD element in particular though, for example:

onready var Game = get_node('/root/Game/')
onready var actionBar = Game.get_node("HUD/VBoxContainer/PlayerStats2/HBoxBars/ProgressBarAction")

Anytime I do this though, all five of the progress bars play the animation at once, when I only want to target the second one. Oddly enough I do not have this problem with my Player scenes, only the HUD elements. Any ideas on why this is happening? Please and thank you.

EDIT: I found the problem! The stylebox I was animating is applied to all the bars I’m trying to animate. That begs the question though, do I have to duplicate the style for each bar or can I have each one reference the same stylebox somehow?

:bust_in_silhouette: Reply From: zhyrin

If the stylebox is external (i.e.: saved to a file), you can make it local to scene, that way changing one should not update the others.

Right click the style and “Make Unique” right?

The only solution I can think of is messy: Click “Editable Children” for each of my PlayerStats nodes and change each style into it’s own unique style. It’s messy because I’d rather not do editable children if I don’t have to, and also I’d like to be able to update each style at once if I want to make small changes to the colors and stuff.

Is there any better solution?

CDHouston7270 | 2023-02-17 18:53