ramokz / phantom-camera

👻🎥 Control the movement and dynamically tween 2D & 3D cameras. Built for Godot 4. Inspired by Cinemachine.
https://phantom-camera.dev/
MIT License
2.17k stars 71 forks source link

Built-in jumping/falling lookahead for 2D? #228

Open elvisish opened 7 months ago

elvisish commented 7 months ago

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

ramokz commented 7 months ago

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.

elvisish commented 6 months ago

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).