Quantcast
Channel: Answers by "brunopava"
Viewing all articles
Browse latest Browse all 64

Answer by brunopava

$
0
0
Make a script like this: function OnTriggerEnter (other : Collider) { if(other.gameObject.tag == "Player") { other.gameObject.SendMessage ("ApplyScore", incomingScoreValue); GameObject.Destroy(gameObject); } } And attach is to the boxes. Then on any of the player's scripts you put a function like this: function ApplyScore(incomingScore:int) { //do whatever you want with the score }

Viewing all articles
Browse latest Browse all 64

Trending Articles



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