How do I stop nodes that have the same script from sharing the same values when using @export?

Godot Version

4.7

I made a portal scene that teleports the player to a new area when stepped on and attached a simple script to it that has some @exportexportexportexportexportexportexportexportexportexportexportexportexportexportexportexport vars to use when teleporting. I then went into my level scene, instantiated the portal scene, and put them where I wanted them, but w@exporten I change their@exportrespe@exportexporttive @export vars they all share the same values from one of the portals and aren’t us@exportng their values I@exportassig@exported.

I read that @export would make each node have unique values, but nothing has worked that I have read from other posts. The only option I can think of at this point is I have to add each portal to the level via code and assign their values at that time for them to be unique.

class_name Portals extends Node

@export var isPortalActive: bool
@export var locationPortalIsAt: String
@export var toCords: Vector2
@export var areaComingFrom: String
@export var areaToGoTo: String

signal sendPlayerNewCords

Called when the node enters the scene tree for the first time.
func _ready() → void:
     get_owner().get_node(“../../Character”).connect(“enteredPortal”,_portal_entered)
     #$“../Character”.connect(“enteredBattlePortal”, _portal_entered)


Called every frame. ‘delta’ is the elapsed time since the previous frame


func _process(_delta: float) → void:
     pass


func _portal_entered() → void:
#if locationPortalIsAt == “Shikaakwa”:
if isPortalActive == true:
    get_owner().get_node(str(areaComingFrom)).visible = false
    get_owner().get_node(str(areaToGoTo)).visible = true
    sendPlayerNewCords.emit(toCords)
else:
    print(“Area coming soon..”)

Is there any reason all of your portals wouldn’t fire when the player emits enteredPortal? It seems like they are all connected to that event so they will all fire at the same time, regardless of which portal is “entered”

Make sure to paste code instead of screenshots

I had a brain overload from something so freaking simple and reading your comment jump started my brain. I emit the signal from my player when he steps on the portal, but never sent WHAT portal he was stepping on along with the signal. Once I added that and changed my code above it works flawlessly. I can’t believe I overlooked something so simple for over a day now :sweat_smile: