initial commit
This commit is contained in:
16
Assets/Scripts/Misc/flickering_light.gd
Normal file
16
Assets/Scripts/Misc/flickering_light.gd
Normal file
@@ -0,0 +1,16 @@
|
||||
extends OmniLight3D
|
||||
@onready var light: OmniLight3D = get_node(".")
|
||||
@onready var timer: Timer = get_node('Timer')
|
||||
|
||||
var randomRange: float = 0.0
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
light.light_energy = lerp(light.light_energy, randomRange, 0.3)
|
||||
|
||||
pass
|
||||
|
||||
func _on_timer_timeout() -> void:
|
||||
randomRange = randf_range(1.5, 4)
|
||||
timer.wait_time = randf_range(0.2, 0.5)
|
||||
pass # Replace with function body.
|
||||
Reference in New Issue
Block a user