How can NPC heard my gun's audio via 'Can Hear Object' task simply?

Kehaw

New member
I want to make a NPC, it can hear all my character audio just like: foot step effects, shoot effects or others.

But you know 'Can Hear Object' task only detect the main object with audio source component, it's ok, I can set the character's 'foot' GameObject to the task's target (cause the footstep auido source attached on foot), it works perfect for me.

But my character's guns are from inventory system, you know I can not specified the gameobject with audio source before start the game.

Int this post I know I can change the code to detecte sub objects audio source, but you know, it is not very well solution.

https://opsive.com/forum/index.php?...d-behavior-designer-can-hear-object-task.334/

My current solution is set all of audio source to the object list:

1710055595520.png
 
Last edited:
Specifying the AudioSources through the target variable is a good method. I actually did something similar for a different project that I was working on.
 
Top