Because of the way we designed one of our scenes, sometimes the player's speech overlaps with some NPCs' random speech. We can't redesign the level, so I'm trying to make the NPCs shut up whenever the player says something (for instance, when he examines an inventory object).
What I've done is to attach a behaviour script to the player's Talk animation, and inject an ActionListAsset to it, which contains a Stop Speech action inside for Specific Characters Only (with "Force off subtitles" activated). I have two characters separated by commas (the names of the parent objects where the NPC script is, although I've tried with the children too). The action gets executed but the NPCs keep talking. Am I missing something here? I just want them to stop talking whenever the player says something.
I'm using Unity 2017.4.36f1 and Adventure Creator 1.66.1.
Thank you
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Character names should be separated by colons, not commas.
It's also easier to do this with script, rather than relying on an ActionList asset that gets called every animation loop:
This will stop all "Background" speech whenever the Player speaks.
@ChrisIceBox as always thank you for the super quick answer - amazing customer support. This solved the problem - I wasn't aware of the ability to subscribe to these sorts of events. Thank you!
No problem. See the Manual's "Custom events" chapter, as well as this tutorial, for more on this topic.