I am making a mini golf game, and when the ball moves a certain distance, it gets points. How would i make it so when it hits a certain amount of points that it would load an either game over scene, or a you win scene? (If over 130 points, lose. If under 120 when it reaches the hole, win) Thank you!
Hello there,
Loading scenes has changed a bit, but now THIS is how you do it:
First add using UnityEngine.SceneManagement;
to the top of your script.
Then, do your check in a similar fashion as this:
if (points > 130)
SceneManager.LoadScene("LossScene");
else if(points < 120)
SceneManager.LoadScene("WinScene");
Note that nothing happens if the points are between 120 and 130 right now.
Hope that helps!
Cheers,
~LegendBacon