Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

Expressions in statements must only be executed for their side-effects?

$
0
0
trying to make health script, but it gives me this error "Expressions in statements must only be executed for their side-effects" var player : GameObject; var health = 1000; function Start() { } function Update() { if(health <= 0) { Debug.log("you are dead"); Destroy(player); } if(health >= 1000) { health = 1000; } } function OnCollisionStay2D(coll: Collision2D) { if(coll.gameObject.tag == "Enemy") { health - 100; //says the error is on this line, but i don't know why. } }

Viewing all articles
Browse latest Browse all 7934

Trending Articles



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