News Forums Sample Projects, How To’s, and Code Samples Pausing Patrol To Play Audio

Tagged: 

This topic contains 3 replies, has 2 voices, and was last updated by  CodersExpo 4 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #27384

    Drum
    Participant

    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.

    #27481

    CodersExpo
    Participant

    You should be able to add a working memory variable in the AIRig that can be set to true when the AI enters the collider. Then use a Condition node to run an idle animation if the variable is true. You can also use an entity/aspect component to detect objects in the game and act accordingly. Does this make sense? Check the wiki docs on the AIRig memory component panel to see how to work with variables.

    #27521

    Drum
    Participant

    I will give these a try, thanks.

    #27595

    CodersExpo
    Participant

    Let me know if I can help.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.