Godot Version
4
Question
Hi,
I’m trying to assign a unique value to each instance of a scene - in this case a mailbox number.
I’m using a global script to get that number and then compare it to another number in another script. This all works fine.
The problem I’m having is the unique value for the variable is only available within the script for that scene. When I try to access it from another script it changes and I’m not sure why.
I’ve tried to create an export variable and change the value there but this doesn’t get passed either. It seems to default to the highest number I input into the export variable space in the inspector and assigns that to every instance of the mail box.
I’m new to godot and coding so I’m unsure what exactly I’m doing wrong. Any help is greatly appreciated.
This works fine. When I print out the box numbers it all works.
But here, when I print out the box number, it has changed to the highest value I have put into the inspector.