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.
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?
Heres the forum:
Thx I’ll try that route instead of the chaos i have going on now to make it work. I’m a VR developer/database admin. I have dealt with way more complex code that’s easier to understand and use, hence the frustration.
Best way to find thigns out is to search in API reference, if you wold search (in doc site) PlayerStart if you click API tab FindPlayerStart and ChoosePlayerStart is first thing that come up, some functions in UE4 are designed to be override (like events, BeginPlay for example in C++, overrideing been introduced in blueprint quite recently… or maybe i missed something ealier :p)
Also learn framework of UE4, so you know where to search things, but i think you already knwo the besics.
Btw there is also function in GameMode to override to dynamiclly pick pawn to spawn too, you might be interested on that too ;]
That thread mentions ChoosePlayerStart in first posts, i guess you didn’t noticed that
I was able to implement a new spawning system using a combination of gamemode, playerstate, and the pawns constructor. Post an answer so I can give u the credit Shadow. Thx man. And when a person post in a Thread examples and then say “DONT DO THIS”, Im probably not going to take any of their advice lol
To be fair to OP. This discussion was the first real hint as to how to manage this. Most of the API isn’t particularly illuminating as it is minimalist.
Most of the function descriptions don’t offer any insight into how they are used. Most follow this pattern:
SetXProperty - set the property for X.
A rewording of the API that could be gleaned from the name itself and doesn’t offer any additional information.
Nor does reading the player start documentation suggest to over~Ride this function:
This was driving me nuts as well. My game is starting in random locations because I placed several starters for my game engine to chose from but during debugging, I just was not able to chose where to start. Not even “Start from camera location” worked anymore. This explanation really helped. And yes, many things need way better documentation than what there is now