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

Kehaw

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.
 
I need help with Can Hear Object, it shouldn't be complicated but I can't do it. I do as in the example. I put an audio source on my character and configured Can Hear Object in Behavior Designer, what am I missing? (In the example I have to bring the green dot closer to the red dot that emits the sound otherwise it doesn't work , Hearing Radius don't help)

edit: The character only hears me if I'm glued to him
 

Attachments

  • can hear .png
    can hear .png
    253.8 KB · Views: 3
Last edited:
problem solved you just have to adjust the source audio, it's one of the things I tried first, I don't know why it didn't work, well anyway what matters is that it works =)

audio source.png
 
Top