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

    Timer at 0 seconds doesn’t fire?

    Scheduled Pinned Locked Moved Unsolved
    Help and Support
    2
    5
    196
    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.
    • AcebossA
      Aceboss
      last edited by

      So, I am just trying out a simple breakout style game, and attempting to move the paddle by touch/holding it to do this, I have a while-holding behaviour set for world coordinates, I save the x coordinate into a box container. Then, I have a timer which reads the box container value, and sets the x position of the paddle object to that value.

      This works ok, if the timer is set to every 1S, although there is obvious lag from the time I move my finger to the time the paddle moves. However if I set the timer to anything less than 1s the paddle does not move at all. The ‘pong’ example states that if a timer is set to 0 then it should attempt to fire every frame, so what’s going on here?

      Note the label does indeed show the x position of where I am touch/holding correctly, and updates every frame (I believe). iit is simply the paddle movement that ceases to work if the timer is set to 0.

      ca5cc269-863d-42a3-82aa-076b1b6f09ba-image.jpeg

      AcebossA 1 Reply Last reply Reply Quote 0
      • AcebossA
        Aceboss @Aceboss
        last edited by

        UPDATE: Move to point works successfully as long as the timer duration is set to >= 0.02

        If, however, timer duration is set to any value < 0.02 (i.e. 0.019, 0.01, 0) then move to point fails. I am not filing this as a bug (yet) because I do not know whether this is expected behaviour.

        Remember: This code works as expected if timer duration >= 0.02 but move to point fails silently if timer duration is set to < 0.02

        985e7e94-093a-43f9-98c5-6a7160b3cc50-image.jpeg

        1 Reply Last reply Reply Quote 0
        • AcebossA Aceboss marked this topic as a question on
        • RobinsonXR
          RobinsonX
          last edited by

          This is case because every time the move behavior is triggered, it resets its previous animation. So using a duration of 0s works because there's no animation.

          AcebossA 1 Reply Last reply Reply Quote 0
          • AcebossA
            Aceboss @RobinsonX
            last edited by

            @RobinsonX Got it (I think) - so if the timer is 0.02 the animation succeeds because there is sufficient time for the move to complete and the starting point to be updated before the next iteration, but in the case of 0 seconds it is firing so fast that the move doesn’t have time to complete and therefore it constantly starts at the same point, is that it?

            RobinsonXR 1 Reply Last reply Reply Quote 0
            • RobinsonXR
              RobinsonX @Aceboss
              last edited by

              @Aceboss Yep!

              If the time to move (duration) is equal to or less than the interval of the timer, then it will be able to complete its movement.

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