0 votes

I only have a control node thats autoloaded and a audioplayer as a child node, but I keep getting an node not found error for the audioplayer node. Am i missing something, isnt it supposed to load from start?

asked Jan 8 in Engine by poopfeast420 (30 points)

Include the singleton setup and the code you're using to try and access it. It's hard to tell you what's wrong without knowing what you have.

the autoload setup is default, haven't touched anything besides the confirm. shows up as globals as name, res://globals/globals.gd as path and enable is checked under singleton

im trying to access it with this inside the globals script. the music node is under the globals node. the globals node is a control node and the music node is an audiostreamplayer2d
var song
song = load("res://assets/213.wav")
$music.set_stream(song)
$music.play()

1 Answer

0 votes

So I'm not sure about the difference yet but it was because I had the script autoloaded, not the scene, but the script autoloads with the scene so it seems like I'd always have to use the scene as a singleton, not the script?

answered Jan 9 by poopfeast420 (30 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.