- Home /
Question by
InformalMods · Jun 25, 2020 at 05:26 AM ·
scripting problemscript.scenescripting beginner
(PLEASE HELP) hi guys! i have a problem with my Score text
READ!!! >>>>>>>>>>>> if the score has 2 then it goes to different scene but if the score is 1 or less then it will move to the scene of not meeting the goal
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement;
public class LoadLevel3 : MonoBehaviour {
public void OnTriggerEnter(Collider other)
{
if (ScoringSystem.theScore >= 1)
{
SceneManager.LoadScene(4);
}
else if (ScoringSystem.theScore <= 2)
{
SceneManager.LoadScene(9);
}
}
}
Comment
You haven't described what is your actual issue with your current code.
Answer by UnityedWeStand · Jun 25, 2020 at 06:48 AM
if (ScoringSystem.theScore > 1)
{
SceneManager.LoadScene(4);
}
else if (ScoringSystem.theScore <= 1)
{
SceneManager.LoadScene(9);
}
ScoringSystem.theScore >= 1
will evaluate to true if the score is 1
Your answer
Follow this Question
Related Questions
How do I make my projectile deal damage to a target it hit. 1 Answer
Tron type Game Question 1 Answer
My Player is going through the floor after crouching 0 Answers
Saving objects through scenes 2 Answers