[SOLVED] Index out of bounds problem

Forums 💬 FlowCanvas ⚙️ Support [SOLVED] Index out of bounds problem

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #22398
    odin
    Participant

      Hi, how can I implement this code in the node without an error ‘Input.GetTouch’ – ‘Index out of bounds’ ?

      I need something like this)

      #22401
      Gavalakis
      Keymaster

        Hello,

        Unfortunately due to the way nodes are working, the AND node will execute both A and B regardless of whether A is false, which in this case impose a problem. Please consider using the Switch Condition to check (if Input.touchCount > 0) and after than make use of GetTouch(0).phase with a SwitchEnum flow control node:

        [attachment file=”TouchPhase.png”]

        (Note: To set the type of the SwitchEnum node, all you have to do is to drag and drop an enum port type like ‘TouchPhase’ is on the newly created SwitchEnum node.)

        Let me know if that works for you.
        Thanks.

        #22400
        odin
        Participant

          Thank you! It works like a clock

          #22399
          Gavalakis
          Keymaster

            Great!
            Thanks for letting me know and I am really glad it works for you!

          Viewing 4 posts - 1 through 4 (of 4 total)
          • You must be logged in to reply to this topic.