Hi,
I try to display my score in game but isn’t work .
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class affichescore : MonoBehaviour {
private Lescore sco;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
sco = GetComponent<Lescore>();
GameObject.Find("Text").GetComponent <Text>().text = "Ton score est : " + sco.scoreplayer;
}
}
using UnityEngine;
using System.Collections;
public class Lescore : MonoBehaviour {
public int scoreplayer = 0;
void OnTriggerEnter(Collider col)
{
scoreplayer = scoreplayer + 1;
print(scoreplayer);
}
}
Help me please ( i’m french)