camera: made camera more responsive and removed camera strafing
This commit is contained in:
parent
e5c1280dd9
commit
7fb2d4b1f9
1 changed files with 7 additions and 8 deletions
|
|
@ -21,8 +21,8 @@ func rotate_camera_x(x, delta):
|
|||
|
||||
func _input(event):
|
||||
if event is InputEventMouseMotion:
|
||||
mouse_x_velocity = event.velocity.x
|
||||
mouse_y_velocity = event.velocity.y
|
||||
mouse_x_velocity = event.relative.x
|
||||
mouse_y_velocity = event.relative.y
|
||||
|
||||
func _process(delta):
|
||||
# rotate outer gimbal around y axis
|
||||
|
|
@ -40,11 +40,10 @@ func _process(delta):
|
|||
mouse_locked = true
|
||||
locked_mouse_positon = get_viewport().get_mouse_position()
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
|
||||
if mouse_x_velocity > 200 or mouse_x_velocity < -200:
|
||||
y -= clamp(mouse_x_velocity / 500,-5,5)
|
||||
if mouse_y_velocity > 200 or mouse_y_velocity < -200:
|
||||
x -= clamp(mouse_y_velocity / 1000,-5,5)
|
||||
if mouse_x_velocity > 5 or mouse_x_velocity < -5:
|
||||
y -= clamp(mouse_x_velocity / 12.5,-10,10)
|
||||
if mouse_y_velocity > 5 or mouse_y_velocity < -5:
|
||||
x -= clamp(mouse_y_velocity / 12.5,-10,10)
|
||||
|
||||
else:
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue