Advertisement
Ragdev

Camera Arm Script

Apr 16th, 2024
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. extends SpringArm3D
  2.  
  3. @export var MouseSensitivity = 0.05
  4.  
  5. func _ready():
  6.     set_as_top_level(true)
  7.  
  8. func _unhandled_input(event):
  9.     if event is InputEventMouseMotion:
  10.         rotation_degrees.x -= event.relative.y * MouseSensitivity
  11.         rotation_degrees.x = clamp(rotation_degrees.x, -90.0, 30.0)
  12.  
  13.         rotation_degrees.y -= event.relative.x * MouseSensitivity
  14.         rotation_degrees.y = wrapf(rotation_degrees.y, 0.0, 360.0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement