Quantcast
Channel: Questions in topic: "count"
Viewing all articles
Browse latest Browse all 187

How to count instantiated objects that passes a given point (transform.position.y)

$
0
0
My instantiated objects move up and user touch to destroy them. I want to count intantiated objects that passes a spesific point. (i want to count how many objects user missed ) So that when counting number reaches a detirmined number, the game will be over. Could please help, What 's wrong with my script. public GameObject[] obj; void Update() { for (int i = 0; i < obj.Length; i++) { if (obj[i].transform.position.y> 4) { countObj(1); //Counting object funtion } } }

Viewing all articles
Browse latest Browse all 187

Trending Articles



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