Skip to content
Snippets Groups Projects
Commit b7ddc7cf authored by Malik Rafsanjani's avatar Malik Rafsanjani
Browse files

fix: resolve bug on angler pet and healthslider

parent 1c713fa2
No related merge requests found
......@@ -47,7 +47,10 @@ public class AnglerAttack : MonoBehaviour
shootRay.direction = transform.forward;
if (timer >= timeBetweenBullets && !GameControl.control.cantShoot && Physics.Raycast(shootRay, out shootHit, range, shootableMask))
{
Shoot();
if (!shootHit.collider.CompareTag("Player"))
{
Shoot();
}
}
if (timer >= timeBetweenBullets * effectsDisplayTime)
......
......@@ -51,6 +51,13 @@ public class PetMovement : MonoBehaviour
if (enemyHealth.currentHealth > 0)
{
nav.SetDestination (enemyPosition.position);
var damping = 2;
var target = enemy.transform;
var lookPos = target.position - transform.position;
lookPos.y = 0;
var rotation = Quaternion.LookRotation(lookPos);
transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime * damping);
}
}
else
......
......@@ -69,6 +69,8 @@ public class PlayerHealth : MonoBehaviour
damaged = false;
frozen = false;
healthSlider.value = currentHealth;
}
public void TakeDamage(int amount)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment