Network issues regarding replication
Hi, I am currently doing multiplayer object spawn with the widget. There has a problem the server cannot see the object spawn from the client.
In Picture 1, I do on the player controller because widget blueprint doesn't have 'switch has authority'.
SpawnItemOnServer I did tick the Run On Server and Reliable.
SpawnItemOnClient I did tick the MultiCast and Reliable.
Picture 2, I do on the widget. If the player releases the button and spawns an object.
asked Mar 24 '19 at 08:03 PM in Using UE4
This is the correct behaviour. The server cannot see widgets as they only persist only on clients.
Could you provide some more information on what you're trying to achieve and we can work out a solution?
answered Mar 24 '19 at 09:00 PM
Spawn item is being called through the interface widget. If the host, or other clients, don't have that widget open, the command won't run. The controller should always be there, so it'd be better to put that action on it or on a character.
ID isn't hooked up. If ID is just meant to find the first widget, it's always going to be 0 since only one widget should be present per machine.
If you're spawning an actor, that actor can be set to replicate and once it spawns on the server, it will also spawn on the clients automatically. When it's destroyed, it'll automatically be removed. Sending an RPC to the clients and spawning items manually should work too, it just ends up being more work than it needs to be unless you have some kind of special prediction in mind.
answered Mar 24 '19 at 09:23 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here