Damus
David Amador profile picture
David Amador
@David Amador
A cool little trick in Godot is that if we put the signal inside a set() on a variable we don't have to search every place where we should trigger it. I know a set_hp(value) function here would work as well but this was just for an example, when you want every place variable is manipulated directly.

2
babble encat · 60w
nostr:nprofile1qy2hwumn8ghj7un9d3shjtnddaehgu3wwp6kyqpqaw2gcqz09z6lq5w5thzcadjsy8n7srs8mczkgs4c5rvjyyfh96ns5sk0gr this is like the properties thing in c#, right?
njamster :godot: · 60w
nostr:nprofile1qy2hwumn8ghj7un9d3shjtnddaehgu3wwp6kyqpqaw2gcqz09z6lq5w5thzcadjsy8n7srs8mczkgs4c5rvjyyfh96ns5sk0gr It's worth noting though that the setter function won't be called for the initial value of the variable, see: https://github.com/godotengine/godot/issues/86494