Question by
LOLD12 · Sep 21, 2017 at 05:36 PM ·
scene2d-platformerscene-loadingproblem during runtimemissingreferenceexception
Unity 5 scene next level scene wont load properly
So i tried to implement a script that changes level when you reach a certain goal in the previous one, but the level just wont load. here are the screenshots of what happens.
Also an error alert comes up saying that the there's a nullreferenceexption in my Soundmanager script, here's the script.
public class SoundManager : MonoBehaviour {
public static SoundManager Instance = null;
//inizializzatore per nuovo soundmanager
//inizializzatore variabili dei suoni
public AudioClip jump;
public AudioClip getCoin;
public AudioClip rockSmash;
public AudioClip mannyDies;
public AudioClip click;
public AudioClip NewGameClick;
public AudioClip EnemyDies;
public AudioClip win;
private AudioSource soundEffectAudio;
void Start () {
//per fare in modo che nessuno possa creare un nuovo suondmanager
if (Instance == null)
{
Instance = this;
}
else if (Instance != this)
{
Destroy(gameObject);
}
AudioSource theSource = GetComponent<AudioSource>();
soundEffectAudio = theSource;
}
public void PlayOneShot(AudioClip clip)
{
soundEffectAudio.PlayOneShot(clip);
//says that the error is here!
}
}
I would be very thankful if you could help me PS: sorry for my bad english
screenshot-25.png
(145.8 kB)
screenshot-24.png
(222.4 kB)
Comment
Your answer
Follow this Question
Related Questions
Why when i change a scene things doesn't change? 0 Answers
My Timeline doesn't works how should do it 0 Answers
Why is my scene not loading? 2 Answers