Simple Shooter Lecture 192

8:47 why does the last known player location need to be updated? does that not only have to be running during investigate?

Also what does the 0 mean in this code:

APawn *PlayerPawn = UGameplayStatics::GetPlayerPawn(GetWorld(),0);
  1. I am currently getting a “video error” from Udemy for this course. Some of my other courses are working fine so can’t view that at moment, but I recall last known player location is used by the AI for the last “seen” location so they know where to go to to look for the player when line of sight is broken.

  2. The “0” is the first player (by index). If you are making a single player game then hard-coding this is fine, but will need to be revised for local or networked multiplayer (not part of this course). If you look at the source or UE documentation for the function you will see the details of the parameter names.

Right, how would it know the last location it saw the player at without doing that? You can’t use the current location of the player.

Privacy & Terms