Hi! i have a enemy and i want to play his sound, i play his sound when the player is near him, but if the player not move, all time it called, like a Update(), how could I call the sound correctly? Thanks :)
if (target != initialPosition && distance < visionRadius)
{
sound.Play();
anim.SetBool("Emerge", true);
anim.SetBool("Hide", false);
Debug.DrawLine(transform.position, target, Color.blue);
}
else
{
anim.SetBool("Hide", true);
anim.SetBool("Emerge", false);
}
And here is my animator and its transitions
https://imgur.com/a/RrhqcG7
↧