0 votes

the code i use for camera is:
extends KinematicBody

const MINCAMERAANGLE = -60
const MAXCAMERAANGLE = 70

export var camera_sensitivity: float = 0.05

onready var head: Spatial = $Head

func ready():
Input.set
mousemode(Input.MOUSEMODE_CAPTURED)

func unhandledinput(event):
if event is InputEventMouseMotion:
handlecamera_rotation(event)

func handlecamerarotation(event):
rotate
y(deg2rad(-event.relative.x * camerasensitivity))
head.rotate
x(deg2rad(-event.relative.y * camerasensitivity))
head.rotation.x = clamp(head.rotation.x, deg2rad(MIN
CAMERAANGLE), deg2rad(MAXCAMERA_ANGLE))

the code

in Engine by (12 points)

head.rotation.x = clamp(head.rotation.x, deg2rad(MINCAMERAANGLE), deg2rad(MAXCAMERA_ANGLE))
I think you just said "X" axis here

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.