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"

Replicate function from Game State

I created two variables in my custom Game State (MyGameState) called MasterNumber and PlayerNumber, they are defaulted to -1. I have a simple UMG blueprint with 2 buttons where a player can click. If a player clicks on the button that has "Master" as text initially, the OnClickEvent calls SetMaster in MyGameState that checks if MasterNumber is -1. If it is, it changes the value of MasterNumber to MyPlayerState->PlayerNumber (note that this is different from MyGameState->PlayerNumber). Once this value changes, another function on the same UMG blueprint that is bound to the text that was initially "Master" should now return a different text. This function checks if MyGameState->MasterNumber is -1, if it is it returns "Master" if not, it returns MyPlayerState->PlayerName for the player with PlayerNumber == MyGameState->MasterNumber.

What happens is, I'm setting MyGameState->SetMaster to be replicated "On the Server". However, it only changes MyGameState->MasterNumber value when I click it from the Server window, and the text on Master button changes on both windows. When I click it from the Client window, nothing happens.

How can I solve this issue?

Product Version: Not Selected
Tags:
more ▼

asked Mar 28 '15 at 06:00 AM in Blueprint Scripting

avatar image

ghostec
1 1 1 1

avatar image Calamus056 May 28 '15 at 08:33 PM

I want to know too if it's normal functionality or a bug.

avatar image Mavicus Jul 27 '15 at 07:13 PM

Having the same issue here when using the Game State for a chat box, I have everything in every Blueprint set to replicate and literally gone overboard with setting to run on the server and authority only, but the client can only talk to himself when it all goes through the Game State and the server can talk to both and tried all sorts of combinations which all lead to the same result.

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

1 answer: sort voted first

For anyone stumbling across this post...

Since the owner of the GameState actor is the server, any server function called through the GameState by a client machine will get dropped. See https://docs.unrealengine.com/latest/INT/Gameplay/Networking/Actors/RPCs/

By this logic you should never have any server functions in your GameState class.

If you want to send an RPC from a client machine to the server you must do this through a client owned actor, i.e. your APlayerController class

more ▼

answered Feb 16 '18 at 05:44 PM

avatar image

Brendon13
6 2 2

(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