Hey guys, I’m working on a top down shooter and I’ve managed to create an AI that can see the player for distance, attack and so on. But if the player shoots and it’s not in the enemy range, the enemy doesn’t do a thing.
So I’d like to make the enemy have hearing awareness, do you guys know any scripts or tools I could use? I don’t know how to code, so basically what I’ve done is by using external tools (such as Deftly) or just checking the web. Thanks
Generally what you’re doing is going to be done with code. You can probably use something like PlayMaker to do it without too much coding, but it will probably take you a lot longer.
Might as well jump right in and learn some rudimentary scripting here: Learn
One basic method to do this is to make a centralized sound notification manager that tracks entities that hear, and entities that produce noise. When a noisemaker makes noise, it sends a message to the manager, then the manager iterates the listeners to decide (based on hearing, distance, etc.) if they hear it or not. If they do, the manager notifies them, perhaps of the location of the player, or else just “something has happened, start being more alert,” whatever is appropriate to your game design.