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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How to do global variables in MULTIPLAYER?

I clicked through many previously asked questions about making global variables with blueprints, and the solutions worked just fine and dandy until I tried to add a second client. Below is my simple test project where I made an actor class named "GlobalVariableDatabase" and gave it one Visible, Replicated integer variable. It has one function that increments the int then prints the new value. I placed an instance of the class in the level to serve as the database for the clients. The clients themselves can press C to access the instance in the level and tell it to increment its integer variable. I started with the Third Person Example project; this is the only code I've added to it.

alt text alt text

I booted it up and took control of Client 1. I incremented the database's int a few times.

alt text

I switched to Client 2 and expected (desperately hoped) that the incrementation would start right where it left off and say 5, but to no avail. The counter was still at 0 for Client 2.

alt text

Of course, when I clicked back to Client 1 and hit C it incremented to 5, as expected. The two clients are just incrementing the int completely separately. Not very 'global' in any sense.

So this is where I'm stuck. What am I doing wrong? How do I fix it? Is this completely the wrong approach or am I missing something really obvious?

Product Version: UE 4.8
1.png (385.6 kB)
2.png (336.2 kB)
3.png (1.6 MB)
4.png (1.6 MB)
more ▼

asked Jul 11 '16 at 01:45 AM in Blueprint Scripting

avatar image

1 1 2 3

avatar image Paul_LTC Mar 25 '19 at 10:26 PM

Bump! I have the exact same problem.

(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