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"

Client send varible to fake server

Hey there , i was working on my project and i had to make event to send some player info using "Run on server" event, And when testing it i find that the varible is not shard between all client when replicated to all clients , this draw shows what i mean:

alt text

Am using player controller to store the varible from player to server here is the blueprint:

alt text

and here is a test i did , it print 0 when they are only one value on client 2 alt text

and when add another value in client 1 it should return 1 but it returned 0 again, alt text Thanks and i hope i can get help.

Product Version: UE 4.22
Tags:
clientserver.png (99.8 kB)
clientserver2.jpg (129.1 kB)
clintserver.jpg (35.5 kB)
clintserver.jpg (30.7 kB)
more ▼

asked May 26 '19 at 10:30 AM in Blueprint Scripting

avatar image

imad laggoune
55 6 7 12

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

1 answer: sort voted first

By "fake server" you mean listen-server as opposed to dedicated server? You can't share info between clients on a PlayerController since each client only have their own PlayerController. If you want to share information you have to do it on an Actor or Pawn that is replicated.

more ▼

answered May 26 '19 at 10:48 AM

avatar image

GarnerP57
1k 3 4 8

avatar image imad laggoune May 26 '19 at 12:08 PM

Thanks for your reply. Sorry about " fake server" is not the name i want say , but after i did that , every client has his own value of that varibal. I dont really want share information , but get to add values in the array by both players ,

And isnt every player has his own pawn or actor , so why Playercontroller is differnet. Thanks again

avatar image GarnerP57 May 26 '19 at 04:00 PM

The server has all PlayerControllers and each client only have their own PlayerController. Each client can communicate with the server through the PlayerController. Its main purpose is to do exactly this... send input to the server. The server can only communicate with that specific client through the PlayerController or it can use (as I mentioned before) a replicated Actor and share with everyone.

avatar image imad laggoune May 26 '19 at 12:31 PM

Thank you so mush, i have made an actor call Server , i put my varibles , and cast Run on Server from player controller

(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