meat_madness_redux/godot/effects/player/Flashlight.gd

11 lines
227 B
GDScript3
Raw Normal View History

2022-11-27 19:55:11 -07:00
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()