Quantcast
Channel: Answers for "Collision counter"
Viewing all articles
Browse latest Browse all 4

Answer by Priyanshu

$
0
0
Considering all the requirements for Collision to occur are fulfilled. Whenever an Object collides with the Object (with the script), OnCollisionEnter event will be called. To get a counter that counts the time OnCollisionEnter is called. Just put a variable inside OnCollisionEnter and increase its value by 1. For example: void OnCollisionEnter2D(Collision2D collision) { counter ++; }

Viewing all articles
Browse latest Browse all 4

Trending Articles



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