12 lines
332 B
GDScript
12 lines
332 B
GDScript
extends SwitchBasic
|
|
|
|
func _on_collision_area_body_entered(body: Node3D) -> void:
|
|
if body.is_in_group("weight"):
|
|
switched_on = true
|
|
SignalBus.emit_signal("switch_changed")
|
|
|
|
func _on_collision_area_body_exited(body: Node3D) -> void:
|
|
if body.is_in_group("weight"):
|
|
switched_on = false
|
|
SignalBus.emit_signal("switch_changed")
|