x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

Product Version: UE 4.9
Tags:
more ▼

asked Oct 17 '15 at 02:18 AM in Using UE4

avatar image

Stunt Thumper
175 13 19 33

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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?

more ▼

answered Oct 17 '15 at 02:44 AM

avatar image

Shadowriver
35.7k 926 168 1104

avatar image Stunt Thumper Oct 17 '15 at 03:21 AM

Heres the forum: https://forums.unrealengine.com/showthread.php?2107-Come-Learn-Blueprint-Multiplayer-with-me!-%28aka-Tom-s-a-Glutton-for-Punishment%29&p=12895&viewfull=1#post12895

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.

avatar image Shadowriver Oct 17 '15 at 03:28 AM

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 ;]

avatar image majieric Feb 22 '17 at 03:58 PM

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:

https://docs.unrealengine.com/latest/INT/Engine/Actors/PlayerStart/

avatar image Shadowriver Oct 17 '15 at 03:30 AM

That thread mentions ChoosePlayerStart in first posts, i guess you didn't noticed that :p

avatar image Stunt Thumper Oct 17 '15 at 04:51 AM

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

avatar image Wallenstein Feb 27 '19 at 12:14 AM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question