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"

Trouble reading GameState var on client

Hi,

I could use a little help with setting up GameState because i can't seem to figure out how to get the variable on the client side, it always returns like it's not set at all. I have a server that host's the game and store match data in GameInstance, then it loads lobby map. This is where im trying to store match data to GameMode and GameInstance, and later show that data on a client's widget.

GameMode, im setting MatchSettings that was previously set in GameInstance: alt text

Pass that settings from GameMode to GameState: alt text

Show match settings on server and client widget alt text

It works fine for server, but when client joins it shows the settings as not set. What am i doing wrong? Im testing locally, i tried both standalone and PIE, same results.

Product Version: UE 4.9
Tags:
capture1.png (111.0 kB)
capture2.png (79.2 kB)
capture3.png (89.7 kB)
more ▼

asked Oct 21 '15 at 04:01 PM in Blueprint Scripting

avatar image

miki86
21 3 5

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Ok i managed to get it working by skipping the GameMode, im setting GameState directly from GameInstance. I don't know if that is the right way and i haven't found any working examples on how to use GameState but it seems that it's working. Client can now see the replicated variable.

more ▼

answered Oct 22 '15 at 07:19 AM

avatar image

miki86
21 3 5

avatar image Enlo Oct 22 '15 at 07:58 AM

Yep, GameMode exists on the server only. That's why you needed to bypass it.

(comments are locked)
10|2000 characters needed characters left
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