Godot Version
4.2.2
Question
Hi all,
I have set up some code in my HUD to modulate a group of objects out of the HUD using a fade-out with the modulate_a keyword. Now it works, the thing is once the process is running I can’t find a way to stop it.
This is the process function:
func _process(_delta):
#only called when all gems are gotten
if(blue_gem_bool && red_gem_bool && green_gem_bool):
#so far so good -one to start with other to follow
# Need to set start, end speed vars
await modulate();
#t.tween_property(gem_text, "modulate/a", 0, 5)
blue_gem_bool = false;
#pass
this is the modulate function:
#modulate the group out of view - fade
func modulate():
# Need to set start, end speed vars
#blue.self_modulate.a = lerp(start,end,speed)
var i = blue.self_modulate.a;
print ("i: "+str(i) );
var x: float = 0;
blue.self_modulate.a = lerp(i, x, .1);
gem_text.self_modulate.a = lerp(i, x, .1);
green.self_modulate.a = lerp(i, x, .1);
red.self_modulate.a = lerp(i, x, .1);
return;
So, it is running but is is continually running. The bool values that start the loop are never set to back to false, and if I do at any point set them to false the lerp will stop running - like I have in my code in the process.
So, how to I setup the code so that the bool variable go back to false at some point and stop the loop continually calling the modulate() function. I tried using await as a method but that didn’t work I was going to try returning a signal but I have no idea how that really works.
So, any and all help is greatly appreciated in this matter.
Regards.