0 votes

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.

Godot version 4.0
in Engine by (12 points)

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

1 Answer

+2 votes
var glow_color = Color.red
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
by (6,262 points)

just for reference glow objects should be the objects node string

No the objects NodePath

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

for object in parent_node.get_children():
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.