I have a particle system (PS for short) that is supposed to instantiate when the object (rock here) gets destroyed. I can see that the PS is being instantiated when the object is destroyed from the hierarchy. But it is not showing up on the game or scene. This is my code:
public class Collector : MonoBehaviour
{
public Text scoreText;
public int score;
public ParticleSystem dest;
void IncreaseScore()
{
score++;
scoreText.text = "Score: " + score;
}
private void OnTriggerEnter2D(Collider2D target)
{
if (target.tag == "Enemy")
{
IncreaseScore();
Instantiate(dest, transform.position, Quaternion.identity);
Destroy(target.gameObject);
}
}
}
I tried changing the position to target.transform.position but to no avail. Tried using Play() as well.