"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? :)
↧