Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | abbos |
Why do I have to rotate the nodes separately to rotate the camera radially?
nodes
Kinematic body
Spatial
Camera
on ready var head = $Spatial
var sensitivity = 0.3
func _ready():
Input.set_mouse_mode(MOUSE_MODE_CAPTURED)
func _input(event):
rotate_y(deg2rad(-event.relative.x * 0.3))
head.rotate_x(deg2rad ( -event.relative.y * 0.3 ))
head.rotation.x = clamp( head.rotation.x , deg2rad(-70), deg2rad(70) )