Map changinbg

This commit is contained in:
2025-07-04 15:02:41 -05:00
parent 7ae9d534ab
commit 29ebb68215
14 changed files with 192 additions and 39 deletions

View File

@@ -1,11 +1,18 @@
class_name MapChangeInteract extends Node3D
@export var mapResource:PackedScene
@export var destinationPointNodeName:String
var interactableArea:InteractableArea
var shapeChild:CollisionShape3D
func _enter_tree() -> void:
interactableArea = $InteractableArea
if !mapResource:
push_error("MapChangeInteract must have a mapResource set.")
return
# Needs to be exactly one child.
if get_child_count() != 2:
push_error("MapChangeInteract must have exactly one child InteractableArea node.")
@@ -31,13 +38,13 @@ func _exit_tree() -> void:
interactableArea.remove_child(shapeChild)
add_child(shapeChild)
func onInteract(ent:Player) -> void:
print("MapChangeInteract: onInteract called")
func onInteract(_ent:Player) -> void:
OVERWORLD.mapChange(mapResource, destinationPointNodeName)
func onInteractable(ent:Player) -> void:
func onInteractable(_ent:Player) -> void:
print("Able to leave map")
pass
func onNotInteractable(ent:Player) -> void:
func onNotInteractable(_ent:Player) -> void:
print("Not able to leave map")
pass