How do I limit camera's Y when the player jumps (scrollY)

0 favourites
  • 4 posts
From the Asset Store
Basic Rounded Vector Geometry Player Design with Glow for 3 player games
  • I'm using the system scroll to smooth scroll as the player moves. The horizontal movement of the camera is flawless.

    The problem is when the player jumps the camera jumps with it which is a bit jarring. I can't disable the scrolly because the platforms are laid in various levels across the Y axis and the camera should follow the player when the Y position changes significantly.

    I've seen a few games where the camera doesn't move vertically when the player jumps but follows as the player moves up and down the y-axis.

    Is there any way to do both smooth scrolling and limiting the camera's Y movement when the player jumps but letting it move as the player moves up and down.

    I hope I'm making this clear.

  • You put the scrollto on an invisible dummy sprite and use that as your 'camera' instead. Just update the dummy sprites x position to match the players.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I tried this and it stabilizes the camera but I still need the camera to move in the Y axis as the player moves around the layout, just not when its merely jumping (unless jumping on a ledge or a higher level platform).

    I've been using the second line code.

  • Just update the dummy sprite with some Y position logic when you need it to follow the player vertically as well as horizontally. You might be able find some 'follow camera' tutorials that go into greater detail.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)