extends Node3D var flickerWait = 0 var flickerWaited = 0 @onready var camera: Camera3D = get_node("../Camera3D") # Called when the node enters the scene tree for the first time. func _ready(): $eyes.visible = !Globals.dead # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta): if Globals.dead: return flickerWaited += delta*1000 if flickerWaited >= flickerWait: flickerWaited = 0 $eyes.visible = !$eyes.visible position.x = randf_range(5, -5) position.y = randf_range(5, -5) position.z = randf_range(0, -15) rotation.y = atan2(camera.position.x- position.x, camera.position.z - position.z) rotation.y = atan2(camera.position.x- position.x, camera.position.z - position.z) flickerWait = randf_range(500, 2500)