I’m facing a really annoying error and it forces me to remove every single line that reads arrays length,
it sends me this error:
NullReferenceException: Object reference not set to an instance of an object
and for example in a line of a script that reads an array’s Length:
public var skidParticles : ParticleSystem[];
public function Update ()
{
if(skidParticles.Length == 0) {skidParticles = new ParticleSystem[1];
skidParticles[0] = Resources.Load("Skid Particle",ParticleSystem);}
}
SO What is wrong with it?! im not able to read the length of that variable?!!
can someone help me with this? i will be very much thankful!
Note: Im using [ExecuteInEditMode] In The script!