Hey folks,
I’m trying to follow CatlikeCoding’s tutorial on 3d graphs in unity. However seems that some features are deprecated. Disclaimer: I’m not terribly experienced with unity. Here’s the tutorial: http://catlikecoding.com/unity/tutorials/graphs/#a-questionmark
Rn i’m at this step of her tutorial:
void Start () {
if (resolution < 10 || resolution > 100) {
Debug.LogWarning ("Grapher resolution is out of bounds, resetting to minimum.", this);
resolution = 10;
float increment = 1f / (resolution - 1);
for (int i = 0; i < resolution; i++) {
float x = i * increment;
points [i].position = new Vector3 (x, 0f, 0f);
points [i].color = new Color (x, 0f, 0f);
points [i].size = 0.1f;
}
points = new ParticleSystem.Particle[resolution];
}
}
// Update is called once per frame
void Update () {
particleSystem.SetParticles(points, points.Length);
}
}
My error is at the line inside of Update(). This is deprecated. So i replaced it by doing:
particles = GetComponent ();
(inside of Start)
Then in update i used: particles.SetParticles(points, points.Length);
However i’m getting an object reference not set to an instance of object error pointing to my Update function. Any help would be appreciated.