I have 2 variables that are referencing 2 objects, every time I press play it shows an error that the path is not correct, but I can see that the path is correct, what could be the issue? the error keeps pointing at _ready func. My dialogue box object has the script.
During _ready the node tree is not yet completely created. If I remember correctly, you can only safely access nodes, that are children. So I can see two different approaches:
get a reference to the other node after the scene tree has been created
change your approach, so that you don’t access $“…” anywhere
I would recommend the second approach. In the long run it will help you to structure your project more modular and allows you to reuse components more easily.
but this worked before for me, right now i added a dialogue manager asset and had to change some stuff in my project, but I don’t think the asset affected this in some way, but I’m not so sure if it worked fine before.
From the error this looks like your DialogueScript is an autoload, if you put this as an autoload the code will fail because the path will be different from the path when the script is attached to the node you show in the photo. Check if you have any autoload with that script:
In this case you need to decide how this script will behave: Or you remove the script from autoload or remove from the dialogue box node and fixes the path to work from the root child.