I am working with a new game with some colleagues and we are all pretty new to Unreal.
Right now I am trying to send a request to the server from my client and tell the server I want a new player.
When all player’s have joined the game they open a new level and I want to send the message in the new level’s blueprint, so I created a custom event which is sent to the server from the client OnBeginPlay, but it seems like OnBeginPlay isn’t running on the client when I switch from one level to another. So I tried a new method. When the level starts the server sends a multicast message to all clients and tells them to send a new response to the server with a request player notification.
All clients receive the multicast message and they all call the custom event which is supposed to be the reply to the server. But the server isn’t getting any message. Any idea how I should handle this problem?
I’m no network programming expert, but I am having luck with networking in my own UE4 game, so maybe I can help.
But I’m having a little trouble understanding what your goal is, and what the problem is. Can you more clearly state what you want to happen? Maybe from a client’s/player’s perspective? And maybe post some screenshots of your Blueprints? I think if you do that, then you will have better luck getting your question answered.
I will try to explain it a bit more
What I want to do is when the level loads I want to send a multicast message from the server to all clients. When the client recieves the message it should reply to the server. All this within the level blueprint.
From what I’ve read this far it seems like a client can’t communicate with the server if it doesn’t own the actor or level in question. Maybe this could be my problem because I ran into the same issue when I spawned an actor on the server and told the client to possess it. The actor gets possessed and can recieve input on the client, but I can’t communicate with the server from the actor by custom events.
I tried to assign the owner to my actor by assigning the PlayerController to it but it seems inpossible to do through blueprints since SetOwner() in the AActor class can’t be called from blueprints.
So, two different problems but they are similar to each other.
Here is a screenshot from my level blueprint. I couldn’t reach my computer at work right now so I made a simpler version of what I want to do:
I’m confused with the same problem. Since it’s nearly a year has passed, I hope somebody can still help me.