and when I enter a trigger it makes a score point. But if I put the script on 2 things it duplicates the GUILayout and makes it look bad and dosent make the score 2. Can
I have some help please!
public var curScore : int = 0;
function OnGUI()
{
GUILayout.Label("Hurtle: " + curScore);
}
then you can do this:
function OnTriggerEnter( other : Collider )
{
GameObject.Find("The Name of the Object you have Score.js on").GetComponent("Score").curScore += 1;
GetComponent(BoxCollider).enabled = false;
}
you just need to put Score.js on an object in the scene.