- Create a new Third Person C++ project
- Create a new C++ Class derived from AISense_Hearing
- Create a new Blueprint derived from AIController
- Add an AIPerception component to the AIController
- In the AIPerception component's details panel under AI Perception add an element to the Senses Config array
- Set the element to AISense_Hearing then expand the element
- Set the Implementation to the C++ class you made in step 2
- Set Detection by Affiliation to true for all cases
- In the Event Graph add an 'On Perception Updated' node then connect it to a 'Print String'
- Compile then close the Blueprint
- Duplicate the ThirdPersonCharacter naming it AI_Character
- Place the AI_Character in the scene near where the player would spawn
- Select the AI_Character in the scene then in the details panel set AI Controller Class to the AIController you made in step 3
- Open ThirdPersonCharacter blueprint
- In the Event Graph add an 'E' pressed event(search for Keyboard E)
- Connect a 'Report Noise Event' node
- Get a Self reference from it connect a 'GetActorLocation' node
- Connect the GetActorLocation node to the Noise Location input pin of the Report Noise Event
- Connect the Self reference to the Instigator
- Compile and close the Blueprint
- Play in Editor
- Press E
Expected Results:
Hello is printed out.
Actual Results:
Nothing happens.