Question by
Telescuffle · Aug 18, 2018 at 12:22 PM ·
audiosourceaudioclipunassiunassignedreferenceexception
I get: 'UnassignedReferenceException' when trying to play a sound clip though a sound source, yet i am assigning it. HELP?!
//Detects collision with player projectile
if (_enemyHit.gameObject.tag == "PlayerProjectile" && isActiveAndEnabled)
{
m_crewVoiceSource.clip = m_destroyedClip;
m_crewVoiceSource.Play();
m_enemyObjectPool.RecycleObjectInPool(_enemyHit.gameObject);
m_enemyObjectPool.RecycleObjectInPool(gameObject);
m_playerController.AddScore(m_score);
m_playerController.AddKillScore();
}
The source is assigned in the inspector and is a gameobject. Yet I'm being told its unassigned.
Any ideas?
Thanks
Comment
Your answer
Follow this Question
Related Questions
How to create buttons that toggle the audio clip playing for a game object? 0 Answers
On iOS Build, Audio Gets Muted When App Loses Focus 0 Answers
Getting nullReferenceException when respawning a gameObject and trying to access the audio source. 0 Answers
Can't get an AudioSource to play on awake 2 Answers
Error FMOD::Sound instance - no sound is being played from AssetBundle 0 Answers