I created trigger.
If to press 'Space' button in the game -> we'll see '1', but if you'll continue to press 'Space' -> will no changes (still '1').
Now, if to change 'state' variable to global, and start rapidly press on the 'Space', we'll recive: 1 2 1 2 1 2 1 2 1 2.
So... I can't understand, why local vars are do not changes?
Quote:
Events
UI - Player Any Player presses Space key Down with shift Allow, control Allow, alt Allow
Local Variables
state = 1.0 <Real>
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
state == 1.0
Then
Variable - Set state = 2.0
UI - Display (Text(state) with Any Precision decimal places) for (All players) to Subtitle area
Else
Variable - Set state = 1.0
UI - Display (Text(state) with Any Precision decimal places) for (All players) to Subtitle area
Local variables are only visible in the focus of the trigger. After you pressed space, a NEW trigger is triggered, which does the same and thus always shows 1
Hey! Sorry for my english, need more practice. :)
I created trigger. If to press 'Space' button in the game -> we'll see '1', but if you'll continue to press 'Space' -> will no changes (still '1'). Now, if to change 'state' variable to global, and start rapidly press on the 'Space', we'll recive: 1 2 1 2 1 2 1 2 1 2. So... I can't understand, why local vars are do not changes?
Local variables are only visible in the focus of the trigger. After you pressed space, a NEW trigger is triggered, which does the same and thus always shows 1
Thank you. :)