0 votes

I have a group saved into an array:

var get_nodes = get_tree().get_nodes_in_group('wpn_icons')

What I want to do is compare the INDEX number of that array to a value. If it matches, it changes the icon's color to the needed palette. It not, it changes the color to a greyscale.


if get_nodes == weapon:
    get_nodes[weapon].material.set_shader_param('r_col1', Color(Blue)
    get_nodes.material.set_shader_param('r_col1', Color(Grey)
asked Aug 27, 2019 in Engine by 9BitStrider (166 points)

1 Answer

0 votes

something like:

if get_nodes[0] == weapon:
     Do stuff
answered Aug 28, 2019 by Sir_Skurpsalot (81 points)
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 How to use this Q&A? before posting your first questions.