phantom-camera icon indicating copy to clipboard operation
phantom-camera copied to clipboard

Built-in jumping/falling lookahead for 2D?

Open elvisish opened this issue 11 months ago • 2 comments

Project Type

2D

Feature Description

Is it possible to have a built-in lookahead distance for jumping and falling that adjusts depending on the falling and jumping speed? I believe it can be done currently by manually adjusting the Follow Target Offsets depending on the Y velocity, but it would be very useful to have it out-of-the-box for a lot of 2D games.

Use Cases

If the character is falling pretty fast or jumping/springing quickly, this would ensure the player doesn't leave the screen.

Importance

Low - there are workarounds where the proposed feature would just simplify things

Usage

Often - a significant amount of projects can find this useful

(Optional) Proposed Solution

No response

elvisish avatar Mar 07 '24 14:03 elvisish

It's not a built-in feature at the minute, but there are plans for implementing it.

There is an existing PR for that, with an explanation for how it ought to work. TLDR; the velocity of the follow target would offset the camera in the direction the target is moving.

ramokz avatar Mar 07 '24 19:03 ramokz

the velocity of the follow target would offset the camera in the direction the target is moving.

Yep, it should also maintain the same distance depending on velocity (so super fast falling, jumping or running doesn't allow the tweening camera position to lag behind).

elvisish avatar Mar 10 '24 19:03 elvisish