From 746a105820df445cace9cfa09003d9ac386be37a Mon Sep 17 00:00:00 2001 From: techrunner Date: Sun, 7 Apr 2024 13:56:24 -0500 Subject: [PATCH] Improved lightig by having it hide when light equals zero --- Assets/components/vapelight.gd | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Assets/components/vapelight.gd b/Assets/components/vapelight.gd index 3dc0629..8fa9bcb 100644 --- a/Assets/components/vapelight.gd +++ b/Assets/components/vapelight.gd @@ -1,7 +1,7 @@ extends SpotLight3D var Power = 0.0 -var MaxPow = 6 +var MaxPow = 10 var is_vaping = false func _ready(): @@ -13,8 +13,12 @@ func _process(delta): light_energy += 1 * delta else: if light_energy > 0: - light_energy -= .50 - + light_energy -= .1 + if light_energy <= 0: + hide() + if light_energy > 0: + show() + func on(): is_vaping = true