i'm trying to make my first mod for lethal company that modifies the audio of the hoarding bug, but i can't find a way to do it because in this line SFXarray = AssetBundle.LoadFromFile(arrayFolderLocation + "AudioBundle2"); throws this error Cannot implicitly convert type 'UnityEngine.AssetBundle' to 'UnityEngine.AssetBundle[]' and i don't know how to fix it, any help is appreciated, thank you
#Mod custom hoarding bug chitterSFX sound
1 messages · Page 1 of 1 (latest)
what is SFXarray?
SFXarray = AssetBundle.LoadFromFile(arrayFolderLocation + "AudioBundle2");
an array if i'm not mistaken
I'm slightly confused what ur trying to do, from your messages in #dev-general you had it working you just needed to pass an array to __instance.chitterSFX instead of a single value?
so it'd just be something like __instance.chitterSFX = [TestModBase.SoundFX[1]]; with the original code u had
Regarding the actual issue LoadFromFile returns a single AssetBundle not an array of them so that'd be where the error for that is coming from
i did that it dosen't show the previous error anymore but it says i'm using c# 7.3 and i have to update then i'll try
well u could also just do an array instead if u dont wanna bother updating c# version, the [] is just the newer syntax
i have no problem on updating and since i started using c# 4 days ago i prefer updating
__instance.chitterSFX = new AudioClip[] { TestModBase.SoundFX[1] }; would be the older version