20 lines
521 B
GDScript
20 lines
521 B
GDScript
extends CSGBox3D
|
|
|
|
@onready var debris_generator: Node3D = get_tree().get_first_node_in_group("generator")
|
|
|
|
@export var stability = 2
|
|
|
|
func _process(_delta: float) -> void:
|
|
|
|
match stability:
|
|
1:
|
|
print("decal")
|
|
##Assumes decal is always 3rd child and checks if object has a decal
|
|
if self.get_children().size() > 0 and self.get_child(0) is Decal:
|
|
$Decal.visible = true
|
|
0:
|
|
print("debris")
|
|
debris_generator.generate_debris(self.global_position, self.size, self.material)
|
|
self.visibility = false
|
|
|