• 0

    posted a message on local variables never changes?

    Thank you. :)

    Posted in: Tutorials
  • 0

    posted a message on local variables never changes?

    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?

    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
    Posted in: Tutorials
  • To post a comment, please or register a new account.