fix: awp fov

This commit is contained in:
DottsGit
2026-06-06 11:05:46 -04:00
parent 8e2b198f94
commit 10416a83a0
3 changed files with 28 additions and 5 deletions
+11 -3
View File
@@ -87,9 +87,15 @@ func _build_model() -> void:
func _process(delta: float) -> void:
super._process(delta)
if not visible:
return
if camera:
var target_fov = ads_fov if is_ads else default_fov
camera.fov = lerpf(camera.fov, target_fov, 15.0 * delta)
var target_fov = ads_fov if is_ads else -1.0
var rig = camera.get_parent()
if rig and rig.has_method("set_weapon_fov"):
rig.set_weapon_fov(target_fov)
# Move model to center when ADS
var target_pos = Vector3(0.0, -0.2, -0.5) if is_ads else Vector3(0.3, -0.3, -0.7)
@@ -116,5 +122,7 @@ 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)
position = Vector3(0.3, -0.3, -0.7)