SlimeoosOdyssey/godot/color_cube.gd

12 lines
280 B
GDScript

extends Node3D
var done = false
func _on_area_3d_body_entered(body):
if done or "color_changes" not in body:
return
done = true
var mat = $ring/Torus.get_active_material(0).duplicate()
mat.albedo_color = body.get_color()
$ring/Torus.set_surface_override_material(0, mat)