SlimeoosOdyssey/godot/color_cube.gd

12 lines
280 B
GDScript3
Raw Normal View History

2023-08-20 02:05:40 -06:00
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)