Hey all, never gotten a response on here so you know I’m desperate to post again. I’m making a 1v1 duel game mode and am currently trying to get the players assigned teams and spawn points. Inside my gamemode BP I’m overriding choose player start, in there I assign the player a team and find that player an appropriate team based spawn point. The issue is that doesnt do anything despite ChoosePlayerStart returning the correct player start that I wish for that player to spawn at. Any idea as to what is going on? I can change the team numbers in single player and it works just fine. Typically that is a replication issue but all data here is handled on the gamemode, the player state has 1 integer that is replicated and set by the gamemode. If you’ve gotten this far thanks for reading. In 5 years I havent gotten a single bit of help so I really appreciate the time.
You could use the PlayerStart->PlayerStartTag (not to be confused with Actor or Component Tags) and Tag them “Team1” “Team2” etc. and find the tagged PlayerStart for the team like this.
Thanks for your response. Unfortunately using tags was my original implementation and going with the team ID integer is not the source of the problem. Both server and client get through with valid data, then nothing happens with it. I tried the Restart Player at Player Start Node as that was new to me, still the same issue.
So I’ve rewritten the logic a few times now. To clarify, I am not struggling with what the process of spawning a player is, it’s fairly trivial. The show the issue better I’ve taken some new shots of my current logic to show that the players get different spawns and simply don’t go to them.
Strange. The AssignToPlayer function doesn’t make much sense since GameMode is not replicated so trying to call an RPC on it is pointless. You also made StartRef replicated which also is pointless again because GameMode is not Replicated it is only on the server.
Tip: when you loop through an array to find something to return you can just return the item right where you are setting the “StartRef”. Then you don’t have to break the loop.
Well when you have a program that simply doesn’t do it’s job, you grow paranoid. As stated in the OP I’m aware of where the “code” exists, there are a few redundancies, none affecting the outcome. As for the break, I like the visual explicitness of branching off of break.
Yes when you get stuck you resort to all sorts of solutions… I’ve been there. I tend to do things like they are done in C++ and there you would just return as soon as possible.
How do you assign the PlayerStarts to the Array?
Watching values in Blueprint are not as reliable as one might hope… I tend to rely on PrintString more than Watches.