Skip to content

Instantly share code, notes, and snippets.

@zvodd
Created February 3, 2026 04:17
Show Gist options
  • Select an option

  • Save zvodd/3550a43d130442c9fc76dc4e7857c9a2 to your computer and use it in GitHub Desktop.

Select an option

Save zvodd/3550a43d130442c9fc76dc4e7857c9a2 to your computer and use it in GitHub Desktop.
Simple FryFlee Cam for Godot 3
extends Camera
var yaw_pitch = Vector2(0,0)
func _process(delta):
var speedmod = 35.0 if Input.is_action_pressed("move_sprint") else 18.0
self.translate(Vector3(
Input.get_axis("move_left","move_right"),
Input.get_axis("equipCamera", "Interact"),
Input.get_axis("move_forward","move_backward")
) * delta * speedmod )
self.transform.basis = Basis(
Quat(Vector3(0.0, 1.0, 0.0), -yaw_pitch.x)
*
Quat(Vector3(1.0, 0.0, 0.0), -yaw_pitch.y)
)
func _input(event):
if event is InputEventMouseButton:
var ev = event as InputEventMouseButton
if ev.pressed:
Input.set_mouse_mode(
Input.MOUSE_MODE_CAPTURED
if Input.get_mouse_mode() != Input.MOUSE_MODE_CAPTURED #^
else Input.MOUSE_MODE_VISIBLE
)
elif event is InputEventMouseMotion and Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
var ev = event as InputEventMouseMotion
yaw_pitch += ev.relative * 1.0 / TAU * 0.01#* ev.speed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment