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

    Create a Smooth (and delayed) Follow Camera: HOW?

    Scheduled Pinned Locked Moved
    Help and Support
    3
    8
    194
    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

      For many reasons it's desirable to have a camera that doesn't respond exactly as the character does.

      Is there a way to achieve this kind of lerping in hyperPad:

      Using maths, and/or physics objects partially or representatively associated with the hero character, I've created some interesting follow cameras. But due to the lack of a tick and/or game loop with specific scheduling, (or lateUpdate or fixedUpdate), there's a lot of spasmodic jumping and stuttering going on, regardless of what I set the timer value to. I've tried 1/30th, 1/60th, 1/120th and 1/240th of a second. All have the same sorts of stuttering, at differing rates.

      I've tried artificially smoothing through damping a joint to the physics body, using "look at" and "move to" type physics observation and forces and air resistance. Nothing creates a smooth follow camera.

      EXTRA INFO:
      My hero character can reverse very quickly, and jumps with a good deal of force, bounces significantly off objects and walls, and lands very hard. So the follow camera mechanism needs to deal with this type of highly dynamic hero.

      Jack8680J 1 Reply Last reply Reply Quote 0
      • Jack8680J
        Jack8680 @Deeeds
        last edited by

        @Deeeds weird, I just tested it and get position seems to be slightly broken for moving objects. Simply moving the screen to the player's position on a timer(0) doesn't look right, even though screen to object works fine on a timer(0). @administrators, bug? (Link to project with bug: http://bit.ly/2yflZgq).

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

          @Jack8680 What does timer(0) do?

          I'm assuming every frame, but what if I have my physics set to calculate every 120th or 240th of a second? Does timer(0) know anything about my physics settings?

          Aidan_FireA Jack8680J 2 Replies Last reply Reply Quote 0
          • Aidan_FireA
            Aidan_Fire @Deeeds
            last edited by Aidan_Fire

            @Deeeds Timer(0) is always 60 repeats per second. The only exception is lag obviously.

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

              @Aidan-Oxley Sorry, I'm not a maths champ. What does "yo" mean?

              Aidan_FireA 1 Reply Last reply Reply Quote 0
              • Aidan_FireA
                Aidan_Fire @Deeeds
                last edited by

                @Deeeds It means I am not good at using iOS 11 keyboard. Edited to fix it lol.

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

                  @Aidan-Oxley Cheers. I thought I was about to have to learn a whole new math abbreviation lexicon. Very thankful I don't.

                  1 Reply Last reply Reply Quote 1
                  • Jack8680J
                    Jack8680 @Deeeds
                    last edited by

                    @Deeeds yeah, it's 60 times per second. It doesn't adjust with your physics speed, but the maximum fps is 60 so you won't need any faster for screen moving.

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