Variable + number goes into an other variable

I’m making a game where I want it to have a lot or RNG (randomness in other words). I’m making a monster that basically has a variable A and a variable B. I want that each 2 second, my variable A + a random number of 0 to 3 goes into my variable B. I don’t know how I can add variable A + the random number to the variable B.
Thanks and have a good day / night!
Also sorry if my english is bad it’s not my main language :confused:

Also how can I transfer a variable (We are gonna say variable C)
between scene? Thanks again and still have a great day / night!

Hi @TheMiddleOne,

For tranferring a variable between scenes you can use a “cospace property”, these are global meaning you can access them anywhere within you cospace. However only use them where neccesary as they do take up more memory than a normal variable.

The random number can be achieved with the “random integer between” block in the green tab; Then you just add a forever loop changing the varB by: varA + a random interger between 0-3.

I have made a little mockup so you can check the code and experiment with the code on your own;

Hope this helps! If you have any other questions let me know.

1 Like