- Home /
Problem is not reproducible or outdated
Instantiated objects have the same Instance ID, how to change this? (JS)
So I have a script that's instantiating pathfinders to navigate through my waypoints. Each pathfinder is individually supposed to record it's path through the network but unfortunately, when it updates it's location, they all update the same information. So at the end of it, I get a long list of waypoints that every pathfinder hit the whole time making it impossible to discern what path to take once the player chooses which waypoint they want to move to.
I used the GetInstanceID function and all the pathfinders seem to return the same information:
CompilerGenerated.__WaypointStatus_OnTriggerEnter$callable1$175_49__
UnityEngine.Debug:Log(Object)
WaypointStatus:OnTriggerEnter(Collider) (at Assets/Scripts/Waypoints/WaypointStatus.js:175)
I think this means that all of the pathfinders have the same instance ID. I believe this is the source of my problem since the computer isn't seeing the pathfinders as separate instances so it updates essentially a single list. Does anyone know how to fix this? How can I separate the instantiated prefabs so the computer sees them as separate objects?
I've been banging my head against a wall for a week now, thanks ahead of time for the help!
-Kaze-