xrjamfeb2025/scenes/target_highlight_test.gd

20 lines
514 B
GDScript

extends StaticBody3D
@export var index: int = 0
@onready var mesh: MeshInstance3D = $MeshInstance3D
func _ready() -> void:
pass
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta: float) -> void:
pass
func _on_proxy_collision_detector_target_occupancy_changed(target_index: int, occupancy: float) -> void:
if target_index == index:
var material = mesh.get_surface_override_material(0)
if material:
material.emission_energy_multiplier = occupancy * 10