So I know that there are a couple of people who will be doing more in depth tutorials in the next few weeks but until then I thought I would share how to do a simple setup to get the new AI Perception system up and running in Blueprint. Also if you want c++ follow this link: https://forums.unrealengine.com/showthread.php?66814-Quick-AI-Perception-Jumpstart-(C-)
(Note this is done in 4.7.5)
- So to start in the controller you want click Add Component and add an AIPerception Component
- Now setup your Sense (this will be what detects stuff) a)Add a new config with type AI Sight config (or whatever you want to use) b) Set the stuff for sight radius and angle (or hearing if your using that)
- Now under Events in the AIPerception Component hit add event. From there you can do stuff when your character detects stuff. The UpdatedActors array is an array of all Actors that it finds.
- So how does it find something? All you have to do is go into the actor or pawn or whatever and in the Begin Play add a Register Perception Stimuli Source node with the class being the type of sense you want to register (just do multiple nodes if you want to use multiple senses) and then set the target to self.
And that’s it, your done! If you AI can see anything registered it should fire the event and you can do stuff accordingly. Let me know if this was helpful or if you have any questions!
Edit: So idk if this will affect everyone but if your having a lot of crashes check this post out: https://answers.unrealengine.com/questions/213839/ai-perception-register-source-issue.html