I want to display the amount of items the players collect in a bar on the screen but I cant figure out how to write that in javascript. This is the code I have.
var itemCount : int;
function OnTriggerEnter(col : Collider){
if(col.tag == "Pick Up"){
Destroy(col.gameObject);
itemCount ++;
}
}
`I would also like to have it displayed on the right upper corner of the screen because I have the health bar on the left side.
↧