Hi I have a scoring system divided in two scripts, I wanted the scene to change when the player reaches a score of 3… Is it possible to add that feature without changing any of the scripts I’ve made?
This are the scripts.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class ScoringSystem : MonoBehaviour
{
public GameObject scoreText;
public static int theScore;
void Update()
{
scoreText.GetComponent<Text>().text = "Objects Collected: " + theScore;
}
}
and
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CollectStar : MonoBehaviour
{
void OnTriggerEnter(Collider other)
{
ScoringSystem.theScore += 1;
Destroy(gameObject);
}
}
,Hi! I wanted to change to the next scene when the player reaches a score of 3, I have no idea of how to do this but I have a fully functional score system which divides in two scripts.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class ScoringSystem : MonoBehaviour
{
public GameObject scoreText;
public static int theScore;
void Update()
{
scoreText.GetComponent<Text>().text = "Objects Collected: " + theScore;
}
}
and
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CollectStar : MonoBehaviour
{
void OnTriggerEnter(Collider other)
{
ScoringSystem.theScore += 1;
Destroy(gameObject);
}
}
Now, can I make that changing scene upon score = 3 without the need to change this two scripts?