Skip to content

Commit

Permalink
Zombies bounce away
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniusnaumann committed Jun 30, 2018
1 parent fcb17f3 commit 4493239
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Neonmania/Assets/Scripts/EnemyController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class EnemyController : MonoBehaviour {

private void OnCollisionEnter(Collision collision) {
if (collision.collider.CompareTag("Player")) {
rb.AddForce((player.transform.position - transform.position).normalized, ForceMode.Impulse);
rb.AddForce(-(player.transform.position - transform.position).normalized * 5, ForceMode.Impulse);
player.GetComponent<PlayerControl>().AddDamage(enemy.attackDamage);
}
}
Expand Down

0 comments on commit 4493239

Please sign in to comment.