Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extends SpringArm3D
- @export var MouseSensitivity = 0.05
- func _ready():
- set_as_top_level(true)
- func _unhandled_input(event):
- if event is InputEventMouseMotion:
- rotation_degrees.x -= event.relative.y * MouseSensitivity
- rotation_degrees.x = clamp(rotation_degrees.x, -90.0, 30.0)
- rotation_degrees.y -= event.relative.x * MouseSensitivity
- rotation_degrees.y = wrapf(rotation_degrees.y, 0.0, 360.0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement