downey
1
using UnityEngine;
using System.Collections;
public class score3 : MonoBehaviour {
public float Score = 0;
void OnCollisionEnter ()
{
Score = Score + 1;
GameObject.Find("score3").guiText.text = Score.ToString(""+Score);
Destroy (gameObject);
}
}
i am gussing that this script is on the object?
cause if so each object always intiates with score =0
so it will always be 1
you need to add somthing like
Score = float.TryParse(GameObject.Find(“score3”).guiText.text);
or even better track the score on the player not on the objects you delete.
sfc.