PlayerLocation and LastKnownPlayerLocation are invalid

Helllo, my problem is that the PlayerLocation and LastKnownPlayerLocation are invalid when running the game. previusly using the same calls they werent. Also when i play the game the ai always goes to the LastKnownPlayerLocation even tho the LastKnownPlayerLocation key is invalid. Here are my screenshots if anyone could help i would apracciate it.



Are you sure that code is being executed? Have you tried adding logs e.g.

if (...)
{
    UE_LOG(LogTemp, Warning, TEXT("%s sees the player"), *GetName())
}
else
{
    UE_LOG(LogTemp, Warning, TEXT("%s lost sight of the player"), *GetName())
}

LogTemp: Warning: I cannot see the player :frowning:
LogTemp: Warning: I can see the player
LogTemp: Warning: I cannot see the player :frowning:
LogTemp: Warning: I can see the player
LogTemp: Warning: I cannot see the player :frowning:
LogTemp: Warning: I can see the player
LogTemp: Warning: I cannot see the player :frowning:
LogTemp: Warning: I can see the player
LogTemp: Warning: I cannot see the player :frowning:
LogTemp: Warning: I can see the player
LogTemp: Warning: I cannot see the player :frowning:
LogTemp: Warning: I can see the player

I just get this as output

There where 2 ais in the map and i was looking at the wrong tree. altough in UE5 i cant seem to find where to change the ai that youre debugging in the tree window.

1 Like

Printing the name was half the point btw, you would have spotted it sooner if you added that.

It should be in the same place, the drop down menu here

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

Privacy & Terms