Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | clambu |
Hi all!
I’m new with Godot.
I’m trying to select the enemy which I want to attack with mouse on a 3D environment. This consist on “glowing” the enemy when mouse_enters/exits and Second, would be to put a small circle under the player if it is selected.
For “glowing” the enemy I would like to get if the material has emission_enabled. According to the documentation[1] I have:
bool emission_enabled
Setter set_feature(value)
Getter get_feature()
So I’m trying the following:
thisMaterial=get_node("MeshInstance").get_surface_material(0)
print(thisMaterial.get_feature(emssion_enabled))
but it doesn’t work, and haven’t been able to figure out how to get/set it. Can someone give me some clues how to use it ?
I came with a solution where I store all the object materials to an array when _ready, then load an specific material when mouse enters, and restore the stored materials when mouse exits., being able to change emission_enabled and the emission level would give me a much more efficient way to proceed.
Thank you very much in advance.
[1] http://docs.godotengine.org/en/latest/classes/class_spatialmaterial.html#class-spatialmaterial