Some Confusion on GetPlayerPawn and WorldContext

In the Toon Tank lesson, we are making a turret that detect the distance to the toon tank. And i have some question regarding the codes.

  1. In GetPlayerPawn(this,0) , is this suppose to return the playable character pawn in the world?

  2. Can we not use GetWorld()->GetFirstPlayerController()->GetPawn() from the previous lecture for the GetPlayerPawn()?

  3. The reason that we pass “this” to the WorldContext, is because “this” is in the world that we are currently on?

  4. Do you always pass “this” to the WorldContext parameter? Because i dont see any other way to use it.

Thank you very much for answering any of the questions.

1 Like
  1. Yes
  2. If you wanted to, should be the same thing essentially
  3. Yes
  4. Anything that is in the world that has a GetWorld() function (you could even use that, though that’s more typing and who wants to type more than necessary? :stuck_out_tongue: ).
2 Likes

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

Privacy & Terms