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"

Player Controller - Player index

How do I know what player index an instance of MyCharacter uses at runtime?

Product Version: Not Selected
Tags:
more ▼

asked Nov 18 '14 at 04:52 PM in Using UE4

avatar image

TM317
76 9 12 18

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

1 answer: sort voted first

What is your setup? The Single Local Player Controller always is 0. If you have more Players playing local together they have Player Controllers with different indices. Do you want to get these controllers?

If you want to get the controller of a specific actor, you can use "Get Controller" instead of "Get Player Controller".

And also, are you coding in c++ or using BP?

A few more information would be nice if you post a question.

more ▼

answered Nov 18 '14 at 06:32 PM

avatar image

eXi
6.8k 333 185 468

avatar image TM317 Nov 18 '14 at 06:53 PM

Get Controller is probably what I was looking for. Does UE4 support local LAN games, or is it all server/client? I guess the question would be if I created a multiplayer game where each player is on there own PC/Tablet/etc... how do I know the correct controller to use? Or would it always be 0 in that case?

P.S. I can code both C++ or BP, it would depend on what I am doing at the time.

avatar image eXi Nov 18 '14 at 07:16 PM

The index is for players at the same PC. Like having 4 Gamepads connected and assigning one to each player. Then you would have PlayerController 0-3.

If you have a Multiplayer Game with Server and Client, the Client only knows his own PlayerController with the Index 0. Only the Servers knows all controllers as far as i know :X but i could be wrong on that last thing.

avatar image TM317 Nov 18 '14 at 07:21 PM

Great that is what I had thought. Thanks for the help.

avatar image eXi Nov 18 '14 at 07:24 PM

Ok i will mark this question as resolved. If you have an issue, feel free to reopen it.

(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