19 lines
630 B
GDScript3
19 lines
630 B
GDScript3
|
extends Node
|
||
|
|
||
|
onready var camera = get_parent()
|
||
|
onready var OnFootPhysics = get_node("../../../../../OnFootPhysics")
|
||
|
onready var default_fov = camera.fov
|
||
|
onready var max_fov = default_fov + 20
|
||
|
var min_speed = 0.5
|
||
|
|
||
|
# Commenting out code only addresses falling, but FOV should also change a bit when sprinting.
|
||
|
func _process(_delta):
|
||
|
pass
|
||
|
#if OnFootPhysics.velocity.y >= 0.0:
|
||
|
#
|
||
|
# return
|
||
|
#var terminal_velocity = -OnFootPhysics.get_terminal_falling_velocity()
|
||
|
#var speed = -OnFootPhysics.velocity.y
|
||
|
#var weight = (terminal_velocity - speed) / (terminal_velocity - min_speed)
|
||
|
#camera.fov = lerp(max_fov, default_fov, weight)
|