Hi, in my 2D game player collect ,coins" and they count of how many has been collected. I want particles flying around the player, but only the number of how many has been collected. So if player collects 7 coins, then 7 coins will be flying around the player. Is it possible? if so, can you help me with the code? I’m code newbie. I know I need to somehow mention (already created and set) particle system in the script and somehow mention and change the Rate Over Time. But I have absolutely no idea how.
Score counter:
public class ScoreManager : MonoBehaviour
{
public static ScoreManager instance;
public TextMeshProUGUI text;
int score;
// Start is called before the first frame update
void Start()
{
if(instance == null)
{
instance = this;
}
}
public void ChangeScore(int coinValue)
{
score += coinValue;
text.text = score.ToString();
}
}