[Closed] How can I resolve ChoosePlayerStart(AController* Player) Player is NULL?
When I try to override
The question has been closed Jun 17 '14 at 04:47 PM by undercover for the following reason:
The question is answered, right answer was accepted
Look on source code suggest it is possible that this function might get null pointer
And give this warning if both playercontroller and return from ChoosePlayerStart will be null "Warning - PATHS NOT DEFINED or NO PLAYERSTART with positive rating"
Maybe try to "if" it out if that happens and return null, i didnt analize possibilities deply but maybe you might got another call with controller. You would need to debug call stack to check what really sends then null and to debug that you need engine call symbols (pdb files) which you can get by compiling the engine.
answered Apr 21 '14 at 05:58 PM
I am also interested in an answer to this question, it seems to be the case at least when the player is first started in the GameMode, not sure if the NewPlayer is null in the match flow when it calls RestartPlayer(AController* NewPlayer) yet.
either way, i found a workaround.
its hackish, but it has gotten me the functionality i wanted and if you haven't found a solution yet, it should work for you as well. you seemz to got the skillz to do this just by description, but in case any n00bs find this post later, i will be explicit for posterity.
put this in your GameMode header:
then when you override it in your GameMode CPP, check it:
and lastly, the GetTeamStart function, which populates the arrays with teamstarts based on their player start tag, which can be edited in the Unreal Editor by clicking on the player start in the viewport and changing the object in the "details" section that says "Player Start Tag"
of course, this assumes that you have already assigned your teams in your PlayerStates, and have added a "GetTeamNum()" function to them, hope this helps SOMEONE out at some point.i would love a more elegant solution to this.
answered Jun 15 '14 at 11:08 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here