cawez_puzzlebox/primitives/button/button.gd
2024-06-22 18:04:25 -04:00

16 lines
312 B
GDScript

extends Area3D
var children = 0
# Called when the node enters the scene tree for the first time.
func _ready():
body_entered.connect(_on_area_entered)
body_exited.connect(_on_area_exit)
func _on_area_entered(body : Node3D) -> void:
children += 1
func _on_area_exit(body : Node3D) -> void:
children -= 1