Topic was automatically imported from the old Question2Answer platform.
Asked By
dellfenian
so I am trying to learn more with godot, and this may have been asked and I just don’t know how to phrase it properly to find the answers I am looking for any help would be appreciated.
What I am trying to accomplish is to create a function that will run in my UpdateUI() function that will give me a modifier for a stat, that I can run for all of my stats. In my mind something along these lines is what it should look like, but I am unsure if this is right and if it is I am unsure as to why it doesn’t work for me.
I would like to keep it as a function so that I can call this function for each stat that I will be giving to my player, or would it be simpler to just move the code to the variable for each one?
The function is not actually doing anything since it simply returns a value and not setting it to anything. You have to set the value in some way for it to do anything. You can do it this way.
Any of those will make the code do something however I noticed that you pass in the argument modifier but then use = to set it to a value meaning that this is equivalent.