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"

Possessing Pawn Multiplayer

Hey, So Im trying to possess a pawn in multiplayer, Client 1 is calling the possess node through a "run on server" custom event, but it does not possess the pawn until I go onto the server and run the possess node directly from there,,, I have no clue as to why it doesnt work, All help is appreciated thanks!!

Product Version: UE 4.14
Tags:
more ▼

asked Jan 06 '17 at 02:58 AM in Blueprint Scripting

avatar image

miketejeda
1 1 2 1

avatar image elitereloaded Jan 06 '17 at 04:11 AM

Can you post screen shots of your blueprints?

avatar image miketejeda Jan 06 '17 at 08:13 AM

for the player array I just left it as 0 for rn but I also change that number dinamacly based on what character I want to possess, anyways,,, Ive tried many different ways to possess the pawn and this is one other way im trying

ue4.png (296.4 kB)
avatar image miketejeda Jan 06 '17 at 08:15 AM

Ive also tried it with the "switch authority node" and running that on server only but nothing seems to work unless I actually run it on the server

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

1 answer: sort voted first

This is wrong because Player Array is returning player states that are in different order for everyone. What you need to do is when you call your custom event on client, you need to pass the controller as a parameter. Even better solution is to have all your Run on Server functions in your PlayerController, since it has an owning client, and server can understand who did the remote call.

TL;DR


  1. You need Custom event that takes PlayerController as a parameter

  2. This event is Run on Server

more ▼

answered Jan 06 '17 at 08:41 AM

avatar image

Holybreath
383 10 7 19

avatar image miketejeda Jan 06 '17 at 08:53 AM

Im running this all on the playercontroller, Ive tried getting the "Get player controller", since its 0 for all clients from my understanding, only different on the server end,, or getting reference to self as well. But that doesnt work either, or how exactly do you mean as a parameter?

avatar image Holybreath Jan 06 '17 at 01:57 PM

I'm not at PC, custom even can have a parameter. So you pass the controller of client, to the server, and server uses it to possess.

(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