Compare value of two variables

Hello guys. Is there a way to compare the value of two variables to find out which is bigger or smaller of the two?
For example you check if Var a> Var b and create a third variable(Var win).

For the first problem, there is a condition called “Compare two numbers” where you can compare almost any two numbers in that scene.

However, I don’t believe there is a event to create a variable. If the variable only has two states, (on/off, win/lose, etc.) consider creating a boolean variable, setting it to false originally, and then setting it to true when you need to.

1 Like

When editing an event, and writing a value, you find the ÎŁ123 tool which contains the different mathematical expressions you can use. 2 of them are min(a, b) and max(a, b) or something like that.
a and b your two values and the min(a, b) will give your the smallest one.

1 Like

Click on “Add condition” in the event, then :

image


Then modify the actions to get:

2 Likes

this might be somewhat unrelated but clearing the misunderstanding

Actually, a variable gets created automatically when you call it from events. Like lets say the variable A doesn’t exist and you have an event that references the variable A. When that happens, the variable will get created automatically.

1 Like

You can use the dedicated condition as @MrMen pointed out or use the condition Compare two numbers. Something like this:


1 Like

@MrMen @Bluzima @julius_sac @Muzan . A bit late with the reply. I just wanted to say that it worked thanks to your help. Thank you.

2 Likes