Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
hyperPad

hyperPad Forum

  1. Home
  2. Help and Support
  3. Timer at 0 seconds doesn’t fire?

Timer at 0 seconds doesn’t fire?

Scheduled Pinned Locked Moved Unsolved Help and Support
5 Posts 2 Posters 1.0k Views 1 Watching
  • 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 Offline
    AcebossA Offline
    Aceboss
    wrote on last edited by
    #1

    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
    0
    • AcebossA Aceboss

      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 Offline
      AcebossA Offline
      Aceboss
      wrote on last edited by
      #2

      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
      0
      • AcebossA Aceboss marked this topic as a question on
      • RobinsonXR Offline
        RobinsonXR Offline
        RobinsonX
        wrote on last edited by
        #3

        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
        0
        • RobinsonXR RobinsonX

          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 Offline
          AcebossA Offline
          Aceboss
          wrote on last edited by
          #4

          @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
          0
          • AcebossA Aceboss

            @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 Offline
            RobinsonXR Offline
            RobinsonX
            wrote on last edited by
            #5

            @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
            0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Search