Lerp Camera and Limiting Follow

Get help using Construct 2

Post » Sat May 28, 2016 11:36 am

Message: rjcook1985 can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Followed this tutorial for scripting out a lerp camera https://www.youtube.com/watch?v=e9Qh4_zsSCo

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.
Posts: 14
Reputation: 374

Post » Sat May 28, 2016 1:34 pm

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. limit-scrollto-based-on-player-position-on-screen_t119292

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.
Posts: 14
Reputation: 374

Post » Sat May 28, 2016 1:48 pm

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
Posts: 934
Reputation: 38,572

Return to How do I....?

Who is online

Users browsing this forum: DjowG, ramyaswetha and 7 guests