Global variables not updating

Godot Version

4

Question

Hi,
I’ve been trying to figure this out myself but can’t seem to understand what the problem is.

I have 3 scripts. One for a letter. One for a letterbox. And a main scene which is a global script.

In the letter script I assign an address, which is a random number.

image

in the letter box script I assign an address through an export variable. (1,2,3,etc.)

image

Then, in the main script, I spawn a letter on a timer, and if they match they will be posted (I haven’t written this part yet.)

The problem I’m having is that the address value doesn’t get passed to the main script. And only the highest letterbox value gets passed.

I don’t know what I’m doing wrong but any help would be appreciated.

Thanks,