Lerp Camera and Limiting Follow

0 favourites
  • 3 posts
From the Asset Store
Simple and easily editable template for a dynamic camera that zooms in and out based on how far apart the players are.
  • Followed this tutorial for scripting out a lerp camera youtube.com/watch

    Works great, except for one thing he didn't cover.

    When my player jumps, the camera jumps with it. Just as scroll to behavior should. But I don't want it to do that, because when I jump, the floor beneath me disappears, and that makes level design not fun for many reasons.

    So the question - how do I force a fixed Y coordinate on the camera when jumping? I want it to lerp every other time. But not when I'm jumping or moving forward in that local space.

    Here is a visual example of my issue -

    Player on floor, where I want camera to be fixed and lerping left/right during movement AND jumping:

    Player jumping, the camera follows, floor disappears beneath:

    And pictures of my Event Sheet:

    Tried everything under the sun I can think of, but just can't wrap my head around the logic needed to do what should be a simple, simple thing. Very annoying.

    Any help is appreciated.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • As a response to this and after tons of looking around the forums, this guys example is probably the closest I could find to what I'm trying to achieve.

    Download the .capx from his page if you need more reference. The only issue here is that the player is always centered in the screen eventually. I would like the player to be situated on either the left or right side, give or take a little padding. Even messing with this for hours, I couldn't achieve it.

    This has not been a productive night to say the least. Someone please help.

  • Just a quick idea.

    1. when On Jump condition triggers, save current player.Y to some variableY

    2. adjust lerping camera conditions so when player "is jumping" (there is such condition) then camera lerp Y cords to the variable Y, otherwise lerp to player.Y

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