Hello, everyone, I have this really simple camera script which moves the camera as player moves its mouse (duh) but this thing is I found out in the internet that there is this lerp() function that can make things even smoother, the problem is that I cant implement in my code.
Any tips?
Here is the code for camera
func _ready() -> void:
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
func _input(event: InputEvent) -> void:
if event is InputEventMouseMotion:
player.rotate_y(-deg_to_rad(event.relative.x * sensitivity))
fps_camera_root_x.rotate_x(-deg_to_rad(event.relative.y * sensitivity))
fps_camera_root_x.rotation_degrees.x = clamp(fp_scamera_root_x.rotation_degrees.x, -70, 80)
But I want to smooth this with lerp, I've read the documentation and tried to implement, here is the code now
func _physics_process(delta: float) -> void:
fps_camera_root_y = fps_camera_root_y.rotation.x.lerp(event, delta * sensitivity)
. . .
And I get this error
How am I supposed the get all of this working? The FPS movement is working just fine, only the lerp its not.