Implementing 3rd-person camera orbit/follow like ps1 Spyro?

Godot Version

<Godot Version 4.2 Stable->

Question

<In the original Spyro trilogy on PS1, moving left or right would make the player orbit around the camera, I’m working on a 3D platformer tribute and hoping to do something similar with my camera but I’m not making any progress so far.

My current Player controller has kind of been Frankenstein-ed together from a handful of tutorials and so my code looks like this:

#Moves camera
twist_pivot.rotate_y(twist_input)
pitch_pivot.rotate_x(pitch_input)
pitch_pivot.rotation.x = clamp(pitch_pivot.rotation.x, deg_to_rad(-30), 
deg_to_rad(30))	

twist_input = 0.0
pitch_input = 0.0

#Tracks mouse for camera control 	
func _unhandled_input(event: InputEvent) -> void:
if event is InputEventMouseMotion:
	if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
		twist_input = - event.relative.x * mouse_sensitivity
		pitch_input = - event.relative.y * mouse_sensitivity

I’ve tried reviewing the Godot documentation but it’s not clicking for me, I’m not sure why but there’s definitely something I’m missing. Has anyone been able to do something like this?

Spyro Camera Orbit

I think the secret of the spyro orbiting movement is actually the the auto-tracking camera.

You make your player movement relative to the camera, but as the camera auto-rotates to smoothly center the player, it changes the player walking direction.

1 Like

Huh, I hadn’t thought about it that way lol. Thanks for the insight, now to try again!

I’m maybe to new to Godot, but I see a LOT of cameras implemented as something in the transform chain of a player, which for me is very wrong. Besides animating the camera for cutscenes etc, the math for moving becomes very weird.
Anyway, I think the camera can be implemented with a distance and yaw-angle to a target object (in world coordinates) for the camera position. The camera would than use for the rotation a lookAt-function to look at the target. Both, new camera position and look at target can be smoothed for a better feel.
You would only need to compute the rotation of the input in relation to the camera’s transform for rotating/moving the character.

1 Like