Using Audio In The Behaviour Tree« Back to Previous Page
I have worked out how to use the basic audio action in my behaviour tree so that my patroling AI, when it detects the player, will stop moving and play its audio clip, but I would like to be able to tell when the clip has finished so that I can trigger another action. Is there any way to tell either whether the clip is playing or has finished, or, alternatively, how long an arbitrary clip is, so that I can tell the AI to wait for that time before executing the next action?
You can access the Audio Source on the game object or Entity Aspect and check the isPlaying. Set a bool status in the AIRig working memory. Use this value in the behavior tree conditional node. Use a timer node to wait. See additional suggestions in the forum with your other posting on this.
Please log in to post questions: