I’m trying to make a monster like The Figure in doors. Basically, it’s blind, and relies on sound to ‘hunt’ the players, it patrols until it ‘hears’ a player.
I’m thinking of the best way’s to achieve this. These are the only two methods that came into my mind:
-
Raycasting, say x (small number) studs, in all directions, if it finds a player and they’re not crouching, they get chased. This would give the impression that it “heard” the player. The only issue I see is that it might be more complex for longer distances and of course, other sorts of sounds.
-
PlaybackLoudness. I know that this is a sound property. I understand it might be possible to loop through all the sounds in the area, and work out their playback loudness and compare that to the distance to determine if the monster should ignore, “check it out”, or run after it.
The truth is, I cannot think of any other ways and am genuinely not sure what is the best way to accomplish this, which method(s) should I use in this scenario (for working out sounds), actually working them out or raycasting, or some other method I cannot think of?
Thanks for any advice.