Hello, I am trying to develop an enemy npc using Ai Perception Component.
What I want is the logic that ai recognizes the player as Sight or Hearing, then moves to that position and returns to the original position if the player is not recognized while moving to that position.
So I tried to test all three deligates in Ai Perception Component.
As far as I know, IsExpired should return true when the actor’s Stimulus Age is over, but Sight does not.
As you can see, IsExpired does not output 1 when the character goes out of the field of Sight (green area).
On the other hand, Hearing returns 1 when the Stimulus Age is over. (call the MakeNoise when jumps.)
Hi, as far as I know the sight sense will give you an update when an actor is no longer in sight (WasSuccessfullySensed() being false then), but will expire after the max age (or never if the max age is set to zero).
What is the max age you have for the sight sense?
As you can see, IsExpired does not output 1 when the character goes out of the field of Sight (green area).
It should become expired after max age time has passed since the character went out of the field of sight (for max age being not zero). If you want to know when the character goes out of the field of sight, you can check WasSuccessfullySensed() in the Stimulus, in your OnDetected function (in your function there, replace Stimulus.IsExpired(), by Stimulus.WasSuccessfullySensed()).