AI characters not heading towards player even though Hearing is triggered

when I set up my Fire function in FireComponent i saw that my AI characters weren’t responding to me firing my gun. Then I realized the print statements for the AI senses was returning None for the target, even though the perception itself was triggered. I am also noticing these errors when playing:

LogBlueprintUserMessages: [FireComponent] X=2879.884 Y=1086.762 Z=-22.222
LogBlueprintUserMessages: [NPC_AI_BP_C_1] PatrolGaurd4 AISense_Hearing None
PIE: Error: Blueprint Runtime Error: Accessed None trying to read property K2Node_ComponentBoundEvent_Actor from function: 'ExecuteUbergraph_NPC_AI_BP' from node: Branch in graph: EventGraph in object: NPC_AI_BP with description: Accessed None trying to read property K2Node_ComponentBoundEvent_Actor
LogBlueprintUserMessages: Early EndPlayMap Detection: Level '/Game/Dynamic/Levels/FirstPersonExampleMap.FirstPersonExampleMap:PersistentLevel' has LevelScriptBlueprint '/Game/Dynamic/Levels/FirstPersonExampleMap.FirstPersonExampleMap:PersistentLevel.FirstPersonExampleMap' with GeneratedClass '/Game/Dynamic/Levels/FirstPersonExampleMap.FirstPersonExampleMap_C
' with ClassGeneratedBy '/Game/Dynamic/Levels/FirstPersonExampleMap.FirstPersonExampleMap:PersistentLevel.FirstPersonExampleMap'
LogBlueprintUserMessages: Late EndPlayMap Detection: Level '/Game/Dynamic/Levels/FirstPersonExampleMap.FirstPersonExampleMap:PersistentLevel' has LevelScriptBlueprint '/Game/Dynamic/Levels/FirstPersonExampleMap.FirstPersonExampleMap:PersistentLevel.FirstPersonExampleMap' with GeneratedClass '/Game/Dynamic/Levels/FirstPersonExampleMap.FirstPersonExampleMap_C'
 with ClassGeneratedBy '/Game/Dynamic/Levels/FirstPersonExampleMap.FirstPersonExampleMap:PersistentLevel.FirstPersonExampleMap'

Any ideas as to what is wrong? I am using UE4 v4.19.2, here is my latest commit

Edit:
I plugged in the return value of SpawnActor to First Person Projectile BP and this seems to return an actual object, but then it just responds to EVERY character firing…

It would probably be easier to have the player use a tag which the AI controller can use e.g. Player and then use Get Owner as the Instigator.

Thank you for the hint Dan, i basically ended up with this and the AI characters now seemed to react to me firing like how Sam demo’d in the lecture:

I just dont understand why i had to feed in the instigator when Sam didnt have to. Is this just a change between 4.13 and 4.19.2?

I’m pretty sure it’s a bug in Sam’s that just magically worked in that version.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms