Im working on my enemy class and I added PawnSensor, I got a problem.
OnSee delegate doesn’t fire at all.
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "AI") UPawnSensingComponent* PawnSensor;
In my code:
PawnSensor = ObjectInitializer.CreateDefaultSubobject<UPawnSensingComponent>(this, TEXT("PawnSensor")); PawnSensor->OnSeePawn.AddDynamic(this, &AZombieCharacter::OnSee); PawnSensor->OnHearNoise.AddDynamic(this, &AZombieCharacter::OnHear);
I created subobject in constructor. It was successful, and then I binded delegate functions in PostInitializeComponent(), it was successful too. I confirmed it’s bound successfully by calling OnSeePawn.IsBound(). Apparently I am following right steps.
OnHear works fine. Enemy can hear noise from emitter. But OnSee is not being fired at all, definitely. I thought it is some kind of collision problem?, so I tried adjust collision settings, and It was not. I have no idea now.
Please, Any idea?