Hi, guys, hard to explain my issue in the title so I am glad you have clicked this
Basically, I have a variable called housingNode that increases by 1 when a button is pressed, this works as tested with a debug.log but then in another method i have a variable called populationNode that is supposed to by housingNode multiplied by 5 yet it is always equal to 0 when called.
I hope these pictures help:
Imgur: The magic of the Internet This picture is of the Population class that is what I was referring to. I know the GainPopulation() works as It was successfully making populationNode equal to 1 * 5 but not equal to housingNode * 5, it always equaled 0.
Imgur: The magic of the Internet This picture isn’t really needed but it just shows where the GainPopulation method is being called every second, this works as I have tested it but it may help in resolving the issue.
I hope I haven’t missed the obvious due to not having coded in a while. Thanks in advance for your help
I managed to fix the issue. Well, kind of a workaround more than fix it I believe but it works now.
I created a new function in my Global_Tick script that, when called, ran the GainHousing() method from the Population script via an instance of the Population script.
thanks for the help.