Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

How to make a GUI bar that counts items collected

$
0
0
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.

Viewing all articles
Browse latest Browse all 1875

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>