Quantcast
Channel: Answers for "Adding "Air" on a collision"
Browsing latest articles
Browse All 4 View Live

Answer by mwbranna

void OnCollisionEnter2D(Collision2D coll) { if (coll.gameObject.tag == "Surface") { air = maxAir; //Is this what you are trying to do? } }

View Article


Answer by DFledermaus

The problem is line 23: var addair = air - 10; You're using 10 instead of maxair (which is 10, but that will cause problems if you ever decide to change maxair) but you also have them in the wrong...

View Article

Browsing latest articles
Browse All 4 View Live


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