how to tie glowing to a variable

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

I’m trying to make different objects glow based on a certain variable
Var: 0
object 1
object 2
object 3

If var is 1,2, or 3 object 1,2, or 3 glows

I have no idea how to do this and no videos or articles are helping.

clarification, I don’t mean tying the color to a var in general but to a already made var

TheRatKingsQuestions | 2022-11-23 20:06

:bust_in_silhouette: Reply From: Wakatta
var glow_color =
var normal_color = Color(1, 1, 1, 1)
var glow_objects = [Object1, Object2, Object3]

func glow_switch(point : int):
    for object in glow_objects:
        object.self_modulate = normal_color
    glow_object[point].self_modulate = glow_color

just for reference glow objects should be the objects node string

TheRatKingsQuestions | 2022-11-23 19:29

No the objects NodePath

If all glow objects share the same parent
You can use this instead

for object in parent_node.get_children():

Wakatta | 2022-11-23 19:37