Is this the right way to possess another pawn?
I was trying to possess another pawn by using the main controller , yet i ended up with this error!
so whenever a player hit (K) will control another pawn, is there a way to do this.
There is a null reference.
You might need another way of getting the reference to the new pawn to posses, with the index of 1 that would be the 2nd player that joined in a multi-player game I think. Instead, loop through Actors of your Pawn class or something to start, and grab the 1st one that's not equal to the pawn you've already got possessed.
Later, you probably want to get the reference to the new pawn you want to posses via a mouse click on it or something.
I think you need to provide a ref to the current possessed pawn to un-possess it.
answered Apr 02 '14 at 10:18 PM
I have a similar problem I am working on and I got a good answer from Epic. I just need to figure out arrays and test it, but I'm pretty sure it will work. Feel free to update the post if you can figure out how to store pawns in an array before I do.
Hope it helps!
answered Jun 04 '14 at 12:23 PM
I maybe wrong on this but but here's my take on it (warning pseudo code)...
In the blueprint you have UnPosses(target = self). "self" in this case is the PlayerController, you don't want to UnPossess(a playercontroller) you want to UnPossess(a pawn). Not sure if this will fix your issue, you need to change your target to the Pawn currently possessed by the player controller..
It looks like you could just drag the blue wire from GetPlayerPawn() to UnPossess, not Possess. You need to possess some other Pawn when you press K, not PlayerPawn, as the "PlayerPawn" is the one that is already currently possessed.
Also, is the Player Index 1? I was under the impression the first player was player 0.
Follow this question
Once you sign in you will be able to subscribe for any updates here