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?