extends Node3D


var material: StandardMaterial3D

# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	var mat = $"Star Bulb".mesh.surface_get_material(1)
	material = mat.duplicate()
	$"Star Bulb".mesh.surface_set_material(1, material)
	$"Star Bulb/Star".mesh.surface_set_material(0, material)
	$AnimationPlayer.play("StarAction")


func _on_target_1_occupancy_changed(value: float) -> void:
	material.emission_energy_multiplier = value * 10
	$AnimationPlayer.speed_scale = value
