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,14 +21,14 @@ func rotate_camera_x(x, delta):
|
||||||
|
|
||||||
func _input(event):
|
func _input(event):
|
||||||
if event is InputEventMouseMotion:
|
if event is InputEventMouseMotion:
|
||||||
mouse_x_velocity = event.velocity.x
|
mouse_x_velocity = event.relative.x
|
||||||
mouse_y_velocity = event.velocity.y
|
mouse_y_velocity = event.relative.y
|
||||||
|
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
# rotate outer gimbal around y axis
|
# rotate outer gimbal around y axis
|
||||||
var y = 0
|
var y = 0
|
||||||
var x = 0
|
var x = 0
|
||||||
|
|
||||||
if Input.is_action_just_pressed("shift_lock"):
|
if Input.is_action_just_pressed("shift_lock"):
|
||||||
if shift_lock == true:
|
if shift_lock == true:
|
||||||
shift_lock = false
|
shift_lock = false
|
||||||
|
|
@ -40,11 +40,10 @@ func _process(delta):
|
||||||
mouse_locked = true
|
mouse_locked = true
|
||||||
locked_mouse_positon = get_viewport().get_mouse_position()
|
locked_mouse_positon = get_viewport().get_mouse_position()
|
||||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||||
|
if mouse_x_velocity > 5 or mouse_x_velocity < -5:
|
||||||
if mouse_x_velocity > 200 or mouse_x_velocity < -200:
|
y -= clamp(mouse_x_velocity / 12.5,-10,10)
|
||||||
y -= clamp(mouse_x_velocity / 500,-5,5)
|
if mouse_y_velocity > 5 or mouse_y_velocity < -5:
|
||||||
if mouse_y_velocity > 200 or mouse_y_velocity < -200:
|
x -= clamp(mouse_y_velocity / 12.5,-10,10)
|
||||||
x -= clamp(mouse_y_velocity / 1000,-5,5)
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue