Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | jGames20 |
I am trying to import audio files from a “res://” directory, but load() is also loading in the .import files along with the audio. See here:
E 0:00:00.626 _load: No loader found for resource: res://audio/sfx/player/footsteps/HardFloor/Footstep_HardFloor_Hard_Variation1.wav.import.
<C++ Error> Method failed. Returning: RES()
<C++ Source> core/io/resource_loader.cpp:286 @ _load()
<Stack Trace> FPCharacter.gd:76 @ GetSFXArrays()
FPCharacter.gd:34 @ _ready()
There are 25 errors like this.
Here is my code for gathering the files:
func GetSFXArrays(pathHF, pathS):
var HardFloorSFX = []
var HF_SoundDirectory = Directory.new()
HF_SoundDirectory .open(pathHF)
HF_SoundDirectory.list_dir_begin(true)
var sfxHF = HF_SoundDirectory.get_next()
while sfxHF != "":
HardFloorSFX.append(load(pathHF + sfxHF))
sfxHF = HF_SoundDirectory.get_next()
print_debug(HardFloorSFX)
HFSoundReturned = HardFloorSFX