I have two button objects in a scene whose purpose is to:
- Set a different value for the same global variable
- Go to the next scene
For example, if the first button is pressed, the global variable ‘test’ is set to 1 and the next scene is loaded. If the second button is pressed, the global variable ‘test’ is set to 2 and the next scene is loaded.
To try and achieve this, I have an object variable ‘test’ set to 1 and 2 in each button respectively. I also have a group ‘buttons’ with the two buttons added there.
My events are as follows:
Condition: Touch or Left mouse button is down
The cursor/touch is on 'buttons'
Action: Do = buttons.Variable(test) to global variable 'test'
But it’s not working. Debugging shows that the global variable ‘test’ doesn’t change. Can someone show me what I’m doing wrong?