Pausing Patrol On Encountering Player« Back to Previous Page

Hi, I’m brand new to RAIN, so please be gentle with me. I have a gameobject with an AI and I can successfully get it to patrol a waypoint route. I added a box collider to the AI and set it to be a trigger. I also added my own script which chooses from a number of audio files and plays one of them. So far so good. What I need, however, is for the AI to stop moving while the audio plays and then resume its patrol when the audio finishes. There should also be delay before the audio can be re-triggered, but the main problem I am getting at this point is just to have the patrol stop when the player enters the collider.
Posted by Drum (Questions:3, Answers:1)
Asked on June 11, 2022 9:37 am
0

You can go at this in a few ways but try creating a AIRig memory bool variable that can be set to true when the box collider is triggered. In the behavior tree create a conditional node that evaluates this variable. So, if true execute a branch that sets idle animation and a timer that sets your memory variable to false after a period so now the condition will fail and another branch of the behavior tree can execute.

Posted by CodersExpo (Questions:0, Answers:17)
Answered On June 13, 2022 4:51 am #