Skip to content
Snippets Groups Projects
Commit b1bf65e9 authored by Robin Halseth Sandvik's avatar Robin Halseth Sandvik
Browse files

Fixed enemy attack to not throw errors.

parent 80511c7e
No related branches found
No related tags found
1 merge request!30Improvements to attacks.
......@@ -98,13 +98,14 @@ namespace BigSock {
var player = other.gameObject.GetComponent<PlayerController>();
if(player != null) {
// Create attack object.
var attack = new AttackStats{
var attack = (AttackStats) new AttackStats{
Damage = Damage,
Knockback = KnockbackForce,
Range = 0,
AttackSpeed = AttackSpeed,
Source = transform.position,
};
Actor = this,
}.Calculate(Stats);
// Get the player to take the damage.
if(player.TakeDamage(attack)){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment