I’m trying to learn some networking, I’ve watched the Unreal networking tutorials, but I still can’t accomplish a very basic task:
If client presses a key to spawn an actor, it spawns and is visible on all other clients & server.
This is what I have so far:
96836-
… But this works only when server presses the key - in this case it shows up in all clients. But when one of clients presses a key to spawn an actor, it shows up only on the client who presses it.
The ‘Replicates’ checkbox is checked on the spawned actor.
I feel like I miss something basic, maybe my brain really doesn’t like networking Any clues?
Here is how you should go for what you want to achieve:
The client presses the key and call a server RPC function/event
In this server RPC, you spawn the new actor
It will be automatically replicated to other clients
In your actual blueprint, your Spawn It event should be a server event. Right now I think you setted up as a multicast event, which only servers can execute. That’s why it only works on server.
When I press ‘2’ on server, it spawns it and shows on both server and client.
When I press ‘2’ on client it does nothing. But the ‘Hello’ string works, so it responds to input correctly.
Did you try to put this blueprint somewhere else ? Usually, this kind of network stuff is done in a PlayerController.
I’m not sure if clients can do much on Level instances.