fix: awp fov
This commit is contained in:
+10
-2
@@ -75,8 +75,14 @@ func _build_model() -> void:
|
||||
func _process(delta: float) -> void:
|
||||
super._process(delta)
|
||||
|
||||
if not visible:
|
||||
return
|
||||
|
||||
|
||||
if camera:
|
||||
camera.fov = lerpf(camera.fov, target_fov, 15.0 * delta)
|
||||
var rig = camera.get_parent()
|
||||
if rig and rig.has_method("set_weapon_fov"):
|
||||
rig.set_weapon_fov(ads_fov if is_ads else -1.0)
|
||||
|
||||
# Move model slightly based on ADS
|
||||
var target_pos = Vector3(0.0, -0.15, -0.6) if is_ads else Vector3(0.3, -0.3, -0.8)
|
||||
@@ -100,6 +106,8 @@ func _start_reload() -> void:
|
||||
func unequip() -> void:
|
||||
is_ads = false
|
||||
if camera:
|
||||
camera.fov = default_fov
|
||||
var rig = camera.get_parent()
|
||||
if rig and rig.has_method("set_weapon_fov"):
|
||||
rig.set_weapon_fov(-1.0)
|
||||
target_fov = default_fov
|
||||
position = Vector3(0.3, -0.3, -0.8)
|
||||
|
||||
Reference in New Issue
Block a user