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"

Widget override functions called always on last client

Hi everyone I can't find the solution for this, let me explain what with an example.

We have 2 clients, Client 1 and Client 2 If i create a widget on each client's Player Controller and display a message 'Hello World' on that widget's event Construct, the log looks like this

Client 1 : Hello World

Client 2: : Hello World

now my problem is when i override a function on the widget lets say 'OnMouseButtonDown' and display a message 'OnMouseButtonDown' in each client, this happens

While Pressing in Client 1 : Client 2 MouseButtonDown

While Pressing in Client 2 : Client 2 Mouse Button Down

If anyone knows why this happens I would apreciate an answer

Edit 1: Only happens on dedicated server

Edit 2: Tried in UE4 v.4.21.2 and 'OnMouseButtonDown' is called returns 'Client -2: Mouse Button Down' on both clients if 'DedicatedServer' checkbox is checked

Edit 3: After 3 days debugging i now discovered that if i call a function to the controller of Client 1 from his widget, althought the message prints Client 2:"blablabla" , the action of that function runs in Client 1 for example, hiding the widget.

Also, a timer inside the Client 1 widget printing a message every second always says Client 1: "blablabla" if in Client 1 or Client 2: "blablabla" if in Client 2, it's only when printing a message in a overrided function that it prints always from the last Client

If this is the normal behaviour is kinda strange

Edit 4:

This is the function in the Player Controller that is called to show the Inventory alt text

The widget alt text

OnDrop function

alt text

OnDragDetected function

alt text

Again, when i call to show the widget its all fine, but as soon as I print something in OnDrop or OnDragDetected or OnMouseButtonDown he always calls from last client, but if I get a timer on Construct ticking, it calls from the right client

Product Version: UE 4.22
more ▼

asked Jun 23 '19 at 09:00 PM in Blueprint Scripting

avatar image

1 2 3

avatar image Shadowriver Jun 23 '19 at 08:05 PM

Can you show the graph?

avatar image morgoth32169 Jun 23 '19 at 08:33 PM

I edited the post, tell me if you need anything else and il post in the reply

avatar image morgoth32169 Jun 23 '19 at 08:39 PM

Funny thig is happening. I just called an event on Client 1 from the OnMouseButtonDown function in the widget, the event is set to run on Server and calls another event set to run on Owning Client and it prints Client 1: Hello, but in the OnMouseButtonDown function if I don't call the run on server event and call the Owning Client instead it prints Client 2: Hello

avatar image Shadowriver Jun 23 '19 at 09:02 PM

Where do you got that print out?

avatar image morgoth32169 Jun 23 '19 at 09:18 PM

In each print screen i showed you, i had a Print String "Hello World" on each of them

avatar image Shadowriver Jun 23 '19 at 09:22 PM

Well i need prints out as i don't have idea what executes what. all i can tell you is fact that Player Controller only exists in there repective clinet (client 1 wont have client 2 player controller) while server will have all of them. This might be related to the issue

avatar image morgoth32169 Jun 23 '19 at 09:35 PM

I have this post i did on Reddit aswell, its a blank project so its easier to spot the problem and has output messages, it also has the steps to reproduce if you wan't to create the project and test it for yourself

link text

(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