- Home /
Cant find my path to sound folder
I made a weapon and in the weapon script im trying to load a sound from path and play it but it seems to fail. After I debugged alot of stuff I came to notice that the path is wrong but i dont know what is wrong, The Debug returns "Null".
C#
using System.IO;
...
AudioClip myClips;
...
void Start ()
{
myClips = Resources.Load("UserAddedStuff/Sounds/Sword/Slash/ss01") as AudioClip;
Debug.Log (myClips.name);
}
...
And one more thing I was trying to add the whole folder as an array but I failed aswell... anyone have any idea how to do it?
Thx in advance guys and sorry for my bad english and grammar!~
Answer by tanoshimi · Oct 09, 2014 at 09:46 PM
"Only assets that are in the Resources folder can be accessed through Resources.Load"
http://docs.unity3d.com/Manual/LoadingResourcesatRuntime.html
I feel so dumb... Thanks!
Im wondering if there is anyway else to access assests without resources.load()?
Your answer
Follow this Question
Related Questions
can Unity Play WMA sound files? 2 Answers
can we add sound to animation 3 Answers
Let Sound Clip wait for x seconds before sounding ? 1 Answer
Particle Sound Emission 1 Answer
button action script 2 Answers