- Home /
How to use Explosion/Detonator Framework
I have just downloaded Explosion/Detonator Framework
I've the following scenario:
- Use the Standard Assets Third Person Controller
- Add RigidBody to Third Person Controller
- Attach the Detonator (from Component Detonator > Detonator)
- Uncheck Detonator "Explode On Start"
- Attach the Detonator Sound (from Component Detonator > Sound)
- Attach NearExplosionA to Detonator Sound
- Attach FarExplosionA to Detonator Sound
I then got the following error: "NullReferenceException DetonatorSound.Update () (at Assets/Standard Assets/Detonator/System/DetonatorSound.cs:27)"
What did I do wrong/miss? Is this a correct way to do it?
Thanks in advance for your help.
Hi All, the link to the package seems to redirect. Where can I get this package?
Answer by pion · Aug 06, 2011 at 09:16 PM
After adding the following in DetonatorSound.cs:
override public void Init()
{
_soundComponent = (AudioSource)gameObject.AddComponent ("AudioSource");
}
void Awake()
{
Init();
}
The NullReferenceException error message went away.
Answer by herp johnson · Nov 07, 2012 at 12:37 AM
He means add this before the override public void Init():
void Awake()
{
Init();
}
Your answer
Follow this Question
Related Questions
Trouble with Detonator 2 Answers
Detonator -- Null reference error when adding component to empty game object 2 Answers
NullReferenceException... 1 Answer
troubleshooting NullReferenceException 2 Answers
NullReferenceException 2 Answers