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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

PlayerController On Possess?

Is there a function on the PlayerController class that is called when that player controller possesses a Pawn? I tried overriding the function APlayerController::Possess, but it seems to only be called on the host of the game and doesn't work for anyone joined in a multiplayer game, and it also feels hacky. Simply put, the player picks a loadout, and I want that loadout applied to their possessed pawn when that pawn is possessed. In my mind, the most logical way to do that is store the loadout in the PlayerController (as it will be persistent if the player dies and respawns), then apply that loadout to the pawn when the controller possesses it.

Product Version: UE 4.19
Tags:
more ▼

asked Apr 19 '18 at 11:53 PM in C++ Programming

avatar image

lyonb96
1 1 3

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

2 answers: sort voted first

It's related to replication, not all objects are avable to players for decurity reason. GameMode is only existing in host the all players PlayerController exists in host as well player have there controller replicated

more ▼

answered Apr 20 '18 at 07:00 AM

avatar image

Shadowriver
36.6k 930 169 1111

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

I use Playercontoller to store information that must persist between Pawns (including dying and respawning). I use PlayerState to store information that must exist on both server and client.

This is because Playercontrollers are NOT the same object on server and client.

more ▼

answered Apr 21 '18 at 07:29 PM

avatar image

mightyenigma
3.8k 18 20 20

(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