Hi i am having an issue playing audio back from my server. It used to work previously but returning to my project some months later I am receiving the following error:
ArgumentNullException: Value cannot be null.
Parameter name: _unity_self
public class PlayThoughts : MonoBehaviour {
public AudioSource audioSource;
//public ThoughtsManager th;
public string thoughtsTag;
public List<string> tempList = new List<string> ();
//Play thought from database here
public void PlaySavedThought(){
audioSource.Stop ();
tempList.Clear ();
thoughtsTag =("");
StartCoroutine(DownloadAudio());
}
public IEnumerator DownloadAudio()
{
// Create a URL and add parameters to the end of it.
string myURL = "HIDDEN";
myURL += "HIDDEN";
// Create our ES2Web object.
ES2Web web = new ES2Web(myURL);
// Start downloading our data and wait for it to finish.
yield return StartCoroutine(web.Download());
foreach (string tags in web.GetTags()) {
tempList.Add (tags);
}
if(web.isError)
{
// Enter your own code to handle errors here.
Debug.LogError(web.errorCode + ":" + web.error);
}
else
{
// We could save our data to a local file and load from that.
//web.SaveToFile("thoughts_tags.txt");
// Or we could just load directly from the ES2Web object.
thoughtsTag = tempList [Random.Range(0, tempList.Count)];
ERROR COMING FROM THIS LINE >>>> audioSource.clip = web.Load<AudioClip>(thoughtsTag);
audioSource.PlayOneShot (audioSource.clip, 0.7f);
}
}
}
I moved this to the Easy Save 2 forum as this seems to be what you're using.
Firstly, I would recommend updating Easy Save 2 if you haven't already done so. You can do this by downloading from the Asset Store, then double-click the update package in Assets/Plugins/Easy Save 3/Legacy/Easy Save 2.unitypackage.
If this doesn't resolve the issue, please could you send the complete error message including line numbers?
I am getting the same error, I can upload and have checked on my server and the files are there but when I try to download I get this error below.
I am using the latest download from unity asset store and the latest playmaker (Unity2018.3.Playmaker.1.9.0.p20.unitypackage) unity 2019.3.9f1
I am still getting this error even after updating.
What can I do to fix it?
EDIT: I did some investigations and the error seems to be related to the fact that you can't have `obj` being null when the lock is acquired and it tries to add the object to the dictionary.
```
I simply changed the relevant part of the `Add` function to:
This thread is about a different issue in Easy Save 2. However, if you want me to look into your issue further then if you could private message me a script or basic project with instructions to replicate it then I'm happy to take a look.