particleSystem.startColor is obsolete

I can’t use the solution offered in the lectures because it’s telling me that particleSystem.startColor is obsolete. Neither Unity nor the docs are offering me a solution. What should I do?

void HandleHits(){
	timesHit++;
	int maxHits = hitSprites.Length + 1;
	if(timesHit >= maxHits){
		breakableCount--;
		levelmanager.BrickDestroyed();
		Debug.Log (breakableCount);
		Object smokePuff = Instantiate(Smoke, gameObject.transform.position, Quaternion.identity); //identity = defualt upright
		smokePuff.particleSystem.startColor = gameObject.GetComponent<SpriteRenderer>().color;
		Destroy (gameObject); //not '.this'
	}else {
		LoadSprites();
	}
}

Sorry, got it:

GameObject smoke = Instantiate(Smoke, transform.position, Quaternion.identity) as GameObject;
smoke.GetComponent().startColor = gameObject.GetComponent().color;

1 Like

Privacy & Terms