fix: awp fov
This commit is contained in:
+11
-3
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user