- Home /
On 2DCollision, particle system prefab does not play
Hello everyone. So basically I have it where on a 2D collision, I want a particle system to play. Now because the game object with the PS is being destroyed, i assumed that's why and I made a prefab. But even then it does not work. I tried not destroying it at all and it does not play, so I guess it is my execution code for the PS that is wrong, even though the function runs fine.
here is my code and on collision enter 2d func:
void OnCollisionEnter2D(Collision2D collisionInfo)
{
if (collisionInfo.collider.tag == "Bullet")
{
deathFlash.Play();
score+=1;
Destroy(gameObject);
}
~Thanks in advance.
can you be a bit more specific about your object relations? So where is this script part at? what is deathFlash and where do you instantiate it? Also check the following things: is it visible in the camera? enabled? did you check its position for misplacement? Does the particle system play the right thing when you edit it and press play? is the lifetime set to a value large enough?
The destructionpart should only be a problem if the death flash is a particle system on the object that you destroy or on a child of it.