Should a client have authority

I’m trying to implement multiplayer within the firstpersonCharacter template. But for some reason it keeps giving the clients authority as well as the server. However the server never see’s the first person projectile.

When working with multiplayer you need to spawn things on the server and then multicast back to clients.

1 Like

But how do I get the server to spawn the projectile.

1 Like

The clients don’t have “authority,” but if the client calls “spawn actor,” it will still spawn an actor into that client’s world. That will be a local actor. Those are helpful for special effects and predicted events, but they are in no way replicated or “authoritative.”

To make the server spawn the object, you need to make the request call some Event, and make that Event be marked “run on server.” Events that are marked “Run on server” will be forwarded to the server from the owning client, when they are called on that client, using RPC. Note that there will be some network lag involved, so you may want to locally play the “firing” animation/effects even before the server spawns the actual projectile.

1 Like

Well I’ve made the gun spawning on the server. But I still can’t get the server to fire the projectile, is my previous blueprint screenshot correct or am I missing something.

Sorry to ask so many questions, but networking must be the most frustratingly confusing thing there is in UE. I understand what I need to happen and why I need it to happen that way, I just have no idea how I’m supposed to implement it.

I see that you are running on server, but only for owning client. When executing an anim montage you need to do that on the server as well and use a multicast to the rest of the clients in order to be presented.

I attached a screenshot how to structure and call your spawning of projectile and playing anim montage. Hope that helps to sort things out :slight_smile: