Quantcast
Channel: Questions in topic: "enemy"
Viewing all articles
Browse latest Browse all 1488

Play sound only once.

$
0
0
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

Viewing all articles
Browse latest Browse all 1488

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>