Hi everyone!
I’m trying to make the finish line particles work but when I reach the line with Berry the game crushes due to this error:
As you can see from the next image, the Particle System is linked to the serialized field
Here’s the FinishLine script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class FinishLine : MonoBehaviour
{
[SerializeField] float reloadDelay = 1f;
[SerializeField] ParticleSystem finishEffect;
void OnTriggerEnter2D (Collider2D other){
if(other.tag == "Player"){
finishEffect.Play();
Invoke("ReloadScene", reloadDelay);
}
}
void ReloadScene(){
SceneManager.LoadScene(0);
}
}
Thanks for the help!