Files
mmo/scripts/portal/portal.gd
Marek Le 4fddc74df1 update
2026-03-30 09:03:29 +02:00

14 lines
363 B
GDScript

extends StaticBody3D
func _ready() -> void:
add_to_group("portals")
EventBus.entity_died.connect(_on_entity_died)
func _on_entity_died(entity: Node) -> void:
if entity == self:
queue_free()
func _on_detection_area_body_entered(body: Node3D) -> void:
if body is CharacterBody3D and body.name == "Player":
EventBus.enemy_engaged.emit(self, body)