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

I"Expressions in statements must only be executed for their side effects."

$
0
0
"Expressions in statements must only be executed for their side effects." - Debug Log Hi! Im trying to write my first simple script where the enemy (in this case a capsule) takes damage each time the player clicks the left mouse button. while(Input.GetButtonDown("Fire1")) { health - 25; print("You damaged the enemy!"); if(health <= 0) { print("You killed the enemy!"); Dead(); } } - This is my code. I thought that a while loop could be good in this case as it stops when the health goes 0 or below. Any suggestions on how to fix the error or any improvements? :)

Viewing all articles
Browse latest Browse all 7934

Trending Articles



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