Added check to prevent players from shooting when zoomed in.
parent
50075775cf
commit
fc1f340d93
|
@ -156,17 +156,18 @@ func _input(event) -> void:
|
|||
view_zoom_target = 1.0
|
||||
|
||||
aim(event)
|
||||
|
||||
if Input.is_action_just_pressed("trigger_primary"):
|
||||
|
||||
var can_shoot = true if view_zoom <= 1.05 else false
|
||||
|
||||
if can_shoot and Input.is_action_just_pressed("trigger_primary"):
|
||||
weapon.trigger(0, true)
|
||||
elif Input.is_action_just_released("trigger_primary"):
|
||||
weapon.trigger(0, false)
|
||||
if Input.is_action_just_pressed("trigger_secondary"):
|
||||
if can_shoot and Input.is_action_just_pressed("trigger_secondary"):
|
||||
weapon.trigger(1, true)
|
||||
elif Input.is_action_just_released("trigger_secondary"):
|
||||
weapon.trigger(1, false)
|
||||
|
||||
|
||||
func _process(delta):
|
||||
$Jetpack/GPUParticles3D.emitting = jetpack_active
|
||||
|
||||
|
|
Reference in New Issue