15 lines
508 B
GDScript
15 lines
508 B
GDScript
extends RigidBody
|
|
|
|
func _on_Box_sleeping_state_changed():
|
|
# pass
|
|
if self.sleeping:
|
|
$MeshInstance.get_surface_material(0).albedo_color = Color( 0.0, 1.0, 0.0, 1 )
|
|
else:
|
|
$MeshInstance.get_surface_material(0).albedo_color = Color( 0.0, 0.0, 1.0, 1 )
|
|
|
|
func _on_Box_body_entered(body):
|
|
$MeshInstance.get_surface_material(0).albedo_color = Color( 0.0, 1.0, 0.0, 1 )
|
|
|
|
|
|
func _on_Box_body_exited(body):
|
|
$MeshInstance.get_surface_material(0).albedo_color = Color( 0.0, 0.0, 1.0, 1 )
|