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:

Image


Player jumping, the camera follows, floor disappears beneath:


Image


And pictures of my Event Sheet:

Image

Image

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.
B
5
S
1
Posts: 15
Reputation: 501

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.
B
5
S
1
Posts: 15
Reputation: 501

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
ImageImageImage
B
27
S
16
G
79
Posts: 1,012
Reputation: 44,243


Return to How do I....?

Who is online

Users browsing this forum: adventurist, Blendi1223 and 26 guests