Line Of Sight To does not work

Hi,

For some reason the LineOfSightTo function does not work on my AI character. Codes are quite:

Super::Tick(DeltaSeconds);

	Player = UGameplayStatics::GetPlayerPawn(GetWorld(), 0);
	if (LineOfSightTo(Player))
	{
		UE_LOG(LogTemp, Warning, TEXT("Looking at player"));
		SetFocus(Player);
		MoveToActor(Player, 100.f);
	}
	else
	{
		UE_LOG(LogTemp, Warning, TEXT("Lost Player"));
		ClearFocus(EAIFocusPriority::Gameplay);
		StopMovement();
	}

And the BP setup for AI

Thanks!

Edit: Just found out if I move up to the cube (like super close), it will rotates toward me but still wouldn’t move. Not sure how to fix it.

Just a quick update on the issue. It seems that the function LineOfSightTo has a range, if I move into the collision capsule, the AI will look at me and try to move to my position. But if I move out of the capsule, it can no longer traces me. I don’t recall the function has any range.