Ideas for implementing cinemachine's "simple follow"/"lazy follow"

Godot Version

4.1.3

Question

I recently moved over from unity and I was wondering if anyone could help or link me to any articles that go over how to implement cinemachine’s “simple follow” (or “lazy follow” as it’s now being called).

This type of “lazy follow” is seen in older games like majora’s mask. I assume there’s a name for it but I don’t personally know it. Here’s an example:
simple follow - zelda

As you can see, link can “run around” the camera. The camera only cares that link is a certain distance away, not the direction he is moving in, which is actually explained by cinemachine in their documentation:

Lazy follow interprets the offset and damping values in camera-local space. This mode emulates the action a human camera operator would take when instructed to follow a target.

The camera attempts to move as little as possible to maintain the same distance from the target; the direction of the camera with respect to the target does not matter. Regardless of the orientation of the target, the camera tries to preserve the same distance and height from it.

My current implementation is this:

extends SpringArm3D

@export var target: Node3D

func _process(delta):
	if target:
		position = target.global_position

Unfortunately, I cannot show how my camera behaves on account of this being my first post, but my camera prefers keeping a certain offset to it’s target rather than simply a distance like the “lazy follow”.

I’m hoping someone can help by either giving some ideas or by linking me to any articles that go over how developers handled this implementation in the past. Even just naming the technique will help as well.

Thank you for reading!

You could try using or checking the code of the Phantom Camera plugin which is inspired by cinemachine.

2 Likes

Thank you! I looked into it and experimented with it, but unfortunately, it did not have the feature I was looking for.

You will likely need a camera that isn’t directly attached to the player. What I’d do with this issue:
Add a node structure that contains the camera and a spring arm under the player. I’m ready(), mark it as top-level. Player movement should be expressed relative to the camera (so pushing left and right will make the player run on the camera right direction, so that if you hold right, you’ll run in a circle around the camera. After the player has moved, the camera should look_at() the player. After this step, position your spring arm node from player to camera. Adjust camera position based on spring arm length. Note you could use a ray cast node too if you aren’t using the shape property of a springarm

Hello have you fixed it? I think I have a solution but I need help with moving the camera around with the mouse or touching the screen. (sorry for my english is not my first language).