Hi, I’m currently trying to load and then play a sound file like so:
local sfx, error = sys.load_resource(file_path)
if sfx == nil then
print(error)
return
else
print("sfx loaded successfully")
end
resource.set_sound("/game#sound", sfx)
sound.play("/game#sound")
When I call this code I’m seeing the “sfx loaded successfully” message trigger, but on the resource.set_sound line I’m getting the following error:
“The resource was not found (-3): 16788874045146231225, /game#sound”
I’ve checked in my project and “/game#sound” is the correct URL for the sound component, and printing the file_path variable shows that the value is what I expect it to be .