Files
mmo/scenes/portal/init.gd
Marek Lenczewski f1d34ebf1d update
2026-04-04 00:00:15 +02:00

15 lines
358 B
GDScript

extends StaticBody3D
@export var stats: PortalStats
func _ready() -> void:
add_to_group("portals")
PortalData.register(self, stats)
func _exit_tree() -> void:
PortalData.deregister(self)
func _on_detection_area_body_entered(body: Node3D) -> void:
if body is CharacterBody3D and body.name == "Player":
EventBus.portal_entered.emit(self, body)