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"

Possess on join

How would i go about making Players possess pawns automatically when they join, so the first player to join will take player1, second player2 ,third player3 etc.

i just cant seem to figure it out

Product Version: UE 4.12 Preview
Tags:
more ▼

asked May 31 '16 at 10:58 PM in Using UE4

avatar image

The Dried Bean
1 3 3

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

1 answer: sort voted first

modified from the multiplayer shootout tutorial from epic.

change the OnPossess event to the real built-in EventOnPossess if needed.

alt text

gmpossess.jpg (962.4 kB)
more ▼

answered May 31 '16 at 11:44 PM

avatar image

jblaswu
813 22 11 46

avatar image The Dried Bean Jun 02 '16 at 07:55 PM

Sorry for the late response ill give it a try

avatar image jblaswu Jun 02 '16 at 09:49 PM

Sorry if its not understandable. i get lost on my own BPs sometimes. ill try to explain how i would simplify my example to your needs (this explanation will differ a lot from the screenshot, so try to picture this first, then see the screnshot again):

  • you could start with an Event beginPlay. you get all the actors of class PlayerStart, lets assume (contrary to my example) that you have 4. store that into an array inside the Gamemode BP.

  • on this same blueprint, you have a variable CurrentPlayerStartIndex.

All this will be on 1 same event (Event onPostLogin):

  • Event onPostLogin is a built-in. after a client logs in (the switch is pretty unnecesary, this happens in Gamemode anyways) you can just get the PlayerStart on Index == CurrentPlayerStartIndex.

  • Increment 1 to the CurrentPlayerStartIndex.

  • After you got the PlayerStart, do a SpawnActor of the class you want (assume FirstPersonCharacter class). you use the transform from the Player Start.

  • Take the reference and do a Possess (Target is the initial reference from Event onPostLogin)

and that should be enough if you wanna cover the basic. why i did so much bullsh.....optimization on mine? its only for 2 and i want it to be like that...player 1 on spot of player 1, player 2 on spot of player 2. this explanation above sets the players depending on who logs first.

avatar image The Dried Bean Jun 02 '16 at 09:46 PM

Im assuming PS_Player and PC_Maze are assets for your game, what would these be for my game?

avatar image jblaswu Jun 02 '16 at 09:50 PM

probably nothing, as i call the controller and state for different reasons. like i posted at the beginning, this is for my game, so some nodes would be not needed for you. please refer my other comment to understand the core of the logic

avatar image The Dried Bean Jun 02 '16 at 09:55 PM

ok thanks , and I didn't mean to ask the question twice i accidentally deleted the first one

(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