godot-psd-training/sceen/Area3D/BInboundGateAreaDetection.gd
2024-07-25 17:05:28 +08:00

17 lines
377 B
GDScript

extends Area3D
var waitPeopleCount = 0
func _on_area_entered(area: Area3D) -> void:
var peopleWalkFollow = area.get_parent().get_parent()
if peopleWalkFollow is PlayerPathFollow :
waitPeopleCount += 1
func _on_area_exited(area: Area3D) -> void:
var peopleWalkFollow = area.get_parent().get_parent()
if peopleWalkFollow is PlayerPathFollow :
waitPeopleCount -= 1