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

    Enabling and Disabling Follow Screen

    Scheduled Pinned Locked Moved
    Help and Support
    2
    7
    551
    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.
    • ZuniSoftZ
      ZuniSoft
      last edited by ZuniSoft

      I have a scene that implements parallax backgrounds based on a timer and screen position, works nice and smooth. I have two walls to stop the user at each end of the world (the world is wider than the screen). While playing, the backgrounds show off the end of the world i.e. past the wall.

      42284E9A-2254-48CD-BBD7-269978BE0E4E.jpeg

      I have been wrestling with trying to figure out a way to stop the player at the edge of the screen without the extra backgrounds showing.

      I have been playing with screen and player positions and I am really close. If I try toggling the players follow screen behavior I can get what I want when hitting the wall without the extra background showing. The white edge is the wall.

      440E93F2-D9D0-4AE1-9ED8-648629938694.jpeg

      When I try to re-enable the follow screen behavior, the whole screen shifts… why it doesn’t hold the same screen position is baffling me. The following is what I get when I detect moving away from the wall and re-enabling the follow screen behavior.

      51997A95-5305-4DCA-AEB4-A450B9C50D54.jpeg

      What I want is while not hitting the walls is for the screen to follow the player, this works. When getting to a wall, behave like conform to screen. I can’t use conform to screen as it jacks up the view while the player is jumping. Maybe I am being dull, help!

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

        @krdavis The Screen Follow behaviour will follow the player based on where the player is when the behaviour starts working, I think. It’s also possible the the Screen Follow behaviour is acting strangely when disabled then re-enabled. If you want more proper control over the screen, you could try running a timer with 1÷60, that is ~0.0166666667s, not 0, and using either Screen To Object (on an anchor if you don’t want player in dead centre) or Screen To Point if you want to give the screen exact coordinates based on player coordinates.

        ZuniSoftZ 1 Reply Last reply Reply Quote 0
        • ZuniSoftZ
          ZuniSoft @Aidan_Fire
          last edited by ZuniSoft

          @Aidan_Fire thanks for the timer pointer; however, I am still getting the screen jump when I re-enable follow screen. My screen to point is smooth and accurate. Looks like an issue with the screen follow behavior.

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

            @krdavis Odd, when I just tested out disabling and re-enabling a screen follow behaviour in a test project it behaved exactly as I would expect it to. Maybe it depends on the way you’re using it?

            ZuniSoftZ 1 Reply Last reply Reply Quote 0
            • ZuniSoftZ
              ZuniSoft @Aidan_Fire
              last edited by ZuniSoft

              @Aidan_Fire my player object is moving when I make the change to enable the follow behavior. The trigger to enable is based on a calculation of the player’s position when timer fires at the interval you suggested. Can I see your test project?

              Simple question: how do I, with screen follow on, get the player to the edge of the screen and stop…

              This hiccup has been driving me nuts!

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

                @krdavis Here’s an example project that I think looks like what you might be trying to do. Of course, the nearly transparent large objects should be invisible but I left them visible so you can see them in the test. I hope this helps, all behaviours are in the red square. Screen follow test.tap

                ZuniSoftZ 1 Reply Last reply Reply Quote 1
                • ZuniSoftZ
                  ZuniSoft @Aidan_Fire
                  last edited by ZuniSoft

                  @Aidan_Fire thanks so much, it was a big help! I found the source of my frustration, I had set the wrong anchor on my player and that was causing the screen jumping.

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