Godot Version
4.6
Question
hello is there a way to check if a var or number has increased by a specific amount? for example if i want to write code that triggers when a var hp = 1 becomes 15.
signal my_number_is_15
var hp:int = 1:
set(value):
hp = value
if hp ==15:
my_number_is_15.emit()
This is one of a number of ways to handle this.
A lot depends on how you are structuring your program.
The above code creates a signal that is emitted by the variable hp setter function.