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?
Posted by Drum (Questions:3, Answers:1)
Asked on June 14, 2022 7:10 pm
1

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.

Posted by CodersExpo (Questions:0, Answers:17)
Answered On June 16, 2022 11:14 pm #