At the moment for my kill confirmed style script that each player has their own variant off there is a fixed point limit of 10 points that the player must achieve what I want to do is add a point limit float variable that I can adjust in the menu scene with a slider or buttons How would I achieve this?
here is the script:
public class tokenscoring : MonoBehaviour {
public Text MyText;
private int score;
// add adjustable point limit variable here
// Use this for initialization
void Start () {
MyText.text = "";
}
// Update is called once per frame
void Update () {
MyText.text = "" + score;
}
void OnCollisionEnter (Collision col)
{
if (col.gameObject.tag == "point") {
score = score +1;
}
//change this to whatever the max point limit is
if (score >= 10) {
SceneManager.LoadScene(7);
}
}
}