Download

Accessed None 'CallFunc_Create_ReturnValue' from node Add to Viewport

Hello.

In my Character C++ class I have 2 variables for the Health and the Armor.
The Widget Blueprint accesses these two variables to print them to the HUD.

To instantiate the HUD, though, I have to do it in the Character Blueprint

1.jpg

It works fine. The health and the armor variables get displayed.

The problem only comes when I check the RUN DEDICATED SERVER box. 3.jpg

And this is the error I get:

2.jpg

With multiplayer, pointers do not usually work. Ie. pointer on client is not same as pointer on server. Imo Epic when allowing us to have server and client code in same blueprints (separated by just “Has Authority”) made design mistake. This thing is very confusing. You can have one blueprint graph, but variables as seen on separate sides of “has authority” do not need to be even same or have same values.

First try to add that “has authority” switch.
Second: do checks if pointer is valid and has authority. But instead on “Begin play” do it on event tick. When pointer is valid and graph has autohority use “do once” to setup it. Maybe on server loading this is delayed, and object is not created when “begin play” happens.

Thanks for the reply.

I already added a Has Authority switch.

1.jpg

If I run the instructions only on the REMOTE branch and I start the game with 2 players WITHOUT dedicated server enabled…
Well, i have two players… but only the client will run those instructions.

It’s a double edged sword…

When the player is ALSO the server, I want him to run those instructions!

When running this on server make sure you run it only for player that is owning listen server.
By default this would run for each player on server and then each player on their clients.

I think you have same problems as I discovered in my project recently:
for most multiplayer code to work properly you first need proper session manager code.
This is what i am planning to do in next few days, so cannot give advice yet on this.
Besides that i am about to dig into how shotout game example is made.

So for proper player indexes for every player you need proper code for them to join and leave server.
That means some kind of session manager. I only worry that steam integration will require yeat another rebuild of multiplayer code.

Unreal Engine trats the server-player just as a server… without taking into account that he’s also a client (connected to himself).

To make it work I should only make a session system?

No, what i mean without proper session system there are some errors like you just encountered. Session system will not solve them, but without session system that is made like epic designed you will have even harder time with all those small things in multiplayer.