Variable Math Action. How Do I Make One Variable Equal Another?

guy anermanator 4 months ago in Game Creator updated by Marti (Lead Developer) 4 months ago 1

Hello Sorry to bother you. I am just trying to use the variable math action to make one variable have the same value but the equal sign does not work. I am wondering what the syntax or format needs to be in order to do this.

Simply I have a current score variable and a high score variable. I used a trigger to check once the score variable is changed than a condition to check if the current score is greater than or equal to the high score. the next part of this would be setting the value of those two values to be equal to one another. The rest I can figure out. This part is the only part stumping me. Thank you very much for your time. 

Unity version:
Game Creator version:
Satisfaction mark by guy anermanator 4 months ago

Yeah this might be a bit confusing. Here's a screenshot showcasing how to do this. The Math Action accepts a formula and stores the result into the variable chosen at the "Result" property.

So in this example below we're storing the value at {1} (which is the local variable "a") at {0} (local variable "b"). Hope this makes sense!

If you would like to store "b = a + 1" you would simply change the formula to "{1} + 1" and the result will be stored in "b" (aka {0}).