meat_madness_redux/godot/effects/player/Flashlight.gd

11 lines
227 B
GDScript

extends SpotLight
func _input(_event):
if Input.is_action_just_pressed("toggle_flashlight"):
toggle()
func toggle():
visible = not visible
$AudioStreamPlayer.pitch_scale = rand_range(0.5, 1.2)
$AudioStreamPlayer.play()