Scripts renamed
This commit is contained in:
parent
484fb75fa3
commit
aa35ee5975
17 changed files with 7 additions and 5 deletions
16
scripts/player/player_camera.gd
Normal file
16
scripts/player/player_camera.gd
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
extends Camera3D
|
||||
|
||||
const COLLINEAR = 1.5707963267948966
|
||||
|
||||
@export var SENSITIVITY = 0.02
|
||||
|
||||
func _ready() -> void:
|
||||
# Move to level controller when possible
|
||||
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event is InputEventMouseMotion:
|
||||
get_parent().rotate_y(-event.relative.x * SENSITIVITY)
|
||||
rotate_x(-event.relative.y * SENSITIVITY)
|
||||
rotation.x = clamp(rotation.x,-COLLINEAR,COLLINEAR)
|
||||
orthonormalize()
|
||||
Loading…
Add table
Add a link
Reference in a new issue