Files
HorrorGame/Assets/scripts/vapelight.gd
2024-05-13 18:16:36 -05:00

28 lines
384 B
GDScript

extends SpotLight3D
var Power = 0.0
var MaxPow = 10
var is_vaping = false
func _ready():
light_energy = 0
func _process(delta):
if is_vaping:
if light_energy < MaxPow:
light_energy += 1 * delta
else:
if light_energy > 0:
light_energy -= .1
if light_energy <= 0:
hide()
if light_energy > 0:
show()
func on():
is_vaping = true
func off():
is_vaping = false