missing files
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
extends Node3D
|
||||
|
||||
@onready var spring_arm: SpringArm3D = $SpringArm3D
|
||||
var _desired_length: float = 7.0
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
spring_arm.spring_length = DP.f("cam_spring_length")
|
||||
_desired_length = DP.f("cam_spring_length")
|
||||
spring_arm.spring_length = _desired_length
|
||||
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
@@ -22,9 +24,9 @@ func _unhandled_input(event: InputEvent) -> void:
|
||||
rotation.x = clamp(rotation.x, min_vert, max_vert)
|
||||
|
||||
if event.is_action_pressed("zoom_in"):
|
||||
spring_arm.spring_length = clamp(spring_arm.spring_length - 1.0, min_zoom, max_zoom)
|
||||
_desired_length = clamp(_desired_length - 1.0, min_zoom, max_zoom)
|
||||
if event.is_action_pressed("zoom_out"):
|
||||
spring_arm.spring_length = clamp(spring_arm.spring_length + 1.0, min_zoom, max_zoom)
|
||||
_desired_length = clamp(_desired_length + 1.0, min_zoom, max_zoom)
|
||||
|
||||
if event.is_action_pressed("toggle_mouse_capture"):
|
||||
if Input.mouse_mode == Input.MOUSE_MODE_CAPTURED:
|
||||
@@ -34,4 +36,4 @@ func _unhandled_input(event: InputEvent) -> void:
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
spring_arm.spring_length = DP.f("cam_spring_length")
|
||||
spring_arm.spring_length = _desired_length
|
||||
|
||||
Reference in New Issue
Block a user