How to assign player to a specific player start
The more i learn about this engine the more i hate it. I've now wasted several hours trying to figure out how to spawn a pawn at a specific playerstart. The multiplayer-shooter example is some serious BS. Its riddled with errors. Just placing breakpoints in it produces different results haha. Plus all it does is spawn player randomly -> re-spawn player at a playerstart's world transform. STUPID. I've looked into the massive forum thread on this subject and people claim to have a work around, but IT SHOULDN'T NEED A WORK AROUND! What the hell is the point of a playerstart that is this difficult to assign a player too? Epic you release some dumbness pretty frequently. I've literally found in engine code a comments stating "Not sure why this works", or a variable type called "KindaSmallNumber". Do you guys purposely troll us sometimes? Someone please prove me wrong and throw this question in my face. Show me that the playerstart isnt useless for spawning an assigned player without some dumb hack or workaround. Preferably BP but code is fine too.
asked Oct 17 '15 at 02:18 AM in Using UE4
Just calm down and look around insted of panicing, all you really needed to do is look on GameMode functions.
Override ChoosePlayerStart function in GameMode class, to do that from blueprints you hover over "Functions" and Override button should apper and pick ChoosePlayerStart. That function is called every time before player gets spawned asking to which actor spawn the player (yes it does not need to be PlayerStart), it gives you PlayerController of player that is about to spawn and based on that you return Actor.
In order to point out right PlayerStart you will need to extend it's class, add some variable that assigns the player. Problem is hard to do that. You could put some number and in GameMode on begin play try to find them and put them in order of those numbers in array and based on that recover PlayerStart from that array in ChoosePlayerStart. If you have diffrent criteria, implement them in PlayerStart and try to choose them on ChoosePlayerStart
You need to keep in mind engine design does not try to be in your way, that why PlayerStart does not have much function, since engine don't know what kind of game you gonna make and what spawning system it will have, it's the same reason why engine does not have any inventory system. You design a game and it engine expects from you that if something is missing you gonna code it yourself, so don't expect things gonna be simple.
Also can you point me to thread you mentioned?
answered Oct 17 '15 at 02:44 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here