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"

Why client's entering the car executs on the server window?

I want to do enter in the car for multiplayer. I made the possess when pressed enter in the car key. When i play in the client window and come near the car and press the key possession happened in the server window. How fix that? alt text

alt text

Product Version: UE 4.18
Tags:
10.png (346.1 kB)
11.png (154.3 kB)
more ▼

asked Aug 29 '18 at 05:58 AM in Blueprint Scripting

avatar image

KyklsDro
9 2 2 5

avatar image dZh0 Aug 29 '18 at 08:17 AM

Possession events are only executed on the server for multiple reasons.

Does this cause a game-play problem?

avatar image KyklsDro Aug 29 '18 at 08:57 AM

Yes, how i say, when i press enter in the car key playing as client nothing happen but i know what the pressing on the key is working. But in that time on the server window i see what possession work for server player and i can drive playing as server player. I run the project for 2 players without dedicated server and see 2 windows: the first for server and the second for client.

avatar image dZh0 Aug 30 '18 at 10:00 AM

Try making "Enter In The Car" in the ThirdPersonCharacter (the one without input parameters) "not replicated", remove all the "Switch Has Authority" from the ThirdPersonCharacter and see how it goes.

I can't really track the flow with that many Authority checks around server only events. You can maybe debug the the second player character in the server window and see where it breaks.The chain that bothers me is:

On Acton Press -> Check if is Remote -> Call Event on Server -> Check if has Authority -> Call another Event on Server in GameMode -> Check if has Authority -> Posses which again is only on the server.

Try to simplify that.

avatar image RotemS Aug 30 '18 at 11:01 AM

That's some overly defensive programming. You don't need an authority check in a server only function, by definition it can only execute on the authority machine. Similarly you don't need to check that GameMode is valid before trying to cast it, cast will simply fail if the input object is null/invalid.

avatar image mightyenigma Dec 04 '18 at 11:51 PM

Also GameMode does not exist on non-server machines.

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

0 answers: sort voted first
Be the first one to answer this question
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