Trigger Player Explosion

My particles do not play when I collide with something and the crashParticles are stopped (I have the output of “Something” in my console when I collide with something)
`public class CollisionHandler : MonoBehaviour
{
[SerializeField] float delay = 1f;
[SerializeField] ParticleSystem crashParticles;

void OnTriggerEnter(Collider other) 
{
    StartCrashSequence();
}

private void StartCrashSequence()
{
    crashParticles.Play();
    if(crashParticles.isStopped){
        Debug.Log("Something");
    }
    GetComponent<PlayerController>().enabled = false;
    Invoke("ReloadLevel", delay);

}

void ReloadLevel()
{
    int currentSceneIndex = SceneManager.GetActiveScene().buildIndex;
    SceneManager.LoadScene(currentSceneIndex);
}

}`
No other errors or anything like that, it just does not play the explosion. And yes I am using the particle instanse from the ship, not the particles from the prefab folder.

I changed…nothing. And now it works. No idea why. Programming in a nutshell I guess :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms