Quantcast
Channel: Answers for "Adding "Air" on a collision"
Browsing all 4 articles
Browse latest 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

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 all 4 articles
Browse latest View live




Latest Images