hyperPad hyperPad Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Login

    HOW TO: Ensure the sanctity of Actions?

    Scheduled Pinned Locked Moved
    Help and Support
    2
    4
    133
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      Deeeds
      last edited by Deeeds

      Imagine an object with two Rotate BY behaviours, 30 degrees in each direction.

      A message receiver is hooked up. If the message received says Clockwise, that's what's done. A 90 degree rotation over 3 seconds.

      Similarly, a Counter Clockwise message initiates a 90 degree rotation for 3 seconds in the other direction.

      How do I ensure that one Rotate By finishes before another begins, regardless of when and what messages are received?

      Is there a way to queue the messages? Some other means of ensuring the sanctity of Actions?

      iTap DevelopmentI 1 Reply Last reply Reply Quote 0
      • iTap DevelopmentI
        iTap Development @Deeeds
        last edited by iTap Development

        @Deeeds you could have an array that stores the received messages, and then make a setup that takes the first value in the array(assuming you apppend the new messages), and based on the message, then triggers a rotate behavior. Then when the rotate has completed, get the array count and see if the array has any more messages, and if so, retrigger the setup. If not, then it stops.

        You would need to have the setup get triggered whenever a new index is added, but you would need to turn the “triggering” on or off based on if it is already running the setup or not. You could use behavior off when it starts, and behavior on when it finishes.

        Hopefully that make some sense lol

        D 1 Reply Last reply Reply Quote 0
        • D
          Deeeds @iTap Development
          last edited by

          @iTap-Development Yes, makes sense, and is the same way I considered manually doing it. I'm wondering if there's a more natural, inherent and simpler manner of queueing actions.

          iTap DevelopmentI 1 Reply Last reply Reply Quote 0
          • iTap DevelopmentI
            iTap Development @Deeeds
            last edited by

            @Deeeds yeah it was just off the top of my head...there is probably a better way, but i don’t have anything in mind right now🤷‍♂️

            1 Reply Last reply Reply Quote 0
            • First post
              Last post