Debug Console says:
NullReferenceException: Object reference not set to an instance of an object
DamCtrl.Update () (at Assets/CarScene/Scripts/DamageScripts/DamCtrl.js:62)
DamCtrl.js (Clipped):
var health : float;
var smoke : ParticleSystem;
function Start () {
smoke = gameObject.GetComponent(ParticleSystem);
}
function Update () {
if(health <= 75 && health >= 55){
smoke.Play();
}
}
Line 62 is “smoke.Play();”
What’s missing??