Enemy Health System - Prototype

I implemented a simple health system the same as that shown in the lecture.

A small variation I introduced was I renamed the scorePerHit property to scorePerKill, the scoreBoard.ScoreHit method to scoreBoard.ScoreKill and moved it’s call to the KillEnemy method. This means the player only scores for killing an enemy.

Still need to work out how to avoid giving extra points if they hit an enemy more times than their health/hit points before the object is destroyed.

Add this to OnParticleCollision before the hits = hits-1;

 if(hits<=0) return;
1 Like

Privacy & Terms