How do I get the Player Pawn in Multiplayer?

Hey,
How i get the Player Pawn in Multiplayer? So is it just “Player Index”=0 ?
Or how do i get the pawn of the playing player?

you have to cast to the correct player since there is more than one unless you know that the player you want to do something to is always at a certain index.

So what you can do is get the node GetAllActorsOfClass and use the baseclass of your pawn blueprint. If you are unsure what this class is open your pawn blueprint and look at the top right corner it will tell you what class the blueprint is a child of or you can hover over it in the content folder. Then from there you can casttoYOURBLUEPRINT. But if you are using an overlap you will see an actor pin there you can pull that out and again use casttoYOURBLUEPRINT. Then from there it depends on what you are trying to do.

How about getting a reference to the controller and using GetControlledPawn node?

1 Like

So i have to get the Players Location in a item Blueprint…
I cant follow your instructions…

Error This blueprint (self) is not a Controller, therefore ’ Target ’ must have a connection

So… :confused:

YOu should first get a reference to your player controller using ‘GetPlayerController’ node. Connect a ‘GetControlledPawn’ node to the output of that node to get the Pawn being controlled.