Spawning Projectiles on Clients in a multiplayer shooter game

Hey guys,

I’ve been following this thread in regards to problems occurring with server players not being able to see projectiles that are fired by the client players: Networking problem, server does not see clients actions - Multiplayer & Networking - Epic Developer Community Forums

I understand that I need to communicate with the server in order to spawn anything on the client, but I’m having a nightmare trying to figure it out. I followed WobblyheadedBobs advice to call custom events that run on the server, but I just cannot get my projectiles to fire at all now.

This is the blueprints for my level, I’ve created a custom event set to ‘Run on server’ with ‘Reliable’ checked. From then I’ve tried to call a function called ‘Fire’ that fires the projectiles for each player.

This is the blueprints inside the ‘Fire’ function, setting the spawn point for a projectile as well as managing the maximum ammo.

And finally these are the errors I am recieving. I have a feeling it is because I need to call a Player Class instead of the player itself, I’m just a little unsure where to go from here.

Any help would be greatly appreciated!

Hey JamesPhoenix,

The client is really only considered the owner of his own player controller (and its components), so a “Run on server” event on the level blueprint won’t actually make it to the server. Try defining the projectile event in your player controller blueprint instead.

Also, I forgot to mention that events on the client’s Pawn/Character will work too, since the pawn is controlled by the player controller.

Thank you for such a fast reply!

I’ve placed the firing back into the Player Controller as you suggested, and I’ve had a little more luck with that, (the players can actually fire now) however the server still cannot see any shots the client fires.

I’ve recorded a short clip which can be viewed here:

I’ve shown the replication settings for the projectile at the end of the video, am I doing anything wrong in that area?

If not, how would I fix this in the player controller blueprint? (It is virtually the same as in the image in the original post, just in the player character instead)

The replication settings look fine, but from the video it looks like the client may still be the one spawning the projectile. I’d suggest setting a breakpoint on your SpawnActor node and make sure it is only happening on the server.

Same issue, seen all the threads on this site for it and this one is the most accurate to my problem. Blueprint is not being run on the server at all despite relevancy and replication. The pawn and all movements are replicated from client to server but I can’t shoot and projectiles from it. I’m using the fps bp template. I’ve played with the replication settings on the projectiles, all the scene components and their hierarchies. I messed with the replication settings on the character pawn too. Still cannot get them to shoot replicated on the server. The same pawn is able to shoot on the server and replicate to the client. Not vis versa however.

I also played with some network authority nodes and couldn’t make it work that route either. This should be way simple. Shooting a projectile from a client… I mean what the hell am I doing wrong

Also I bet someone who is a genius could make a probability matrix that could determine where the problem lies depending on the frequency its asked because something this simple sort of makes me thing maybe the issue is in the project settings somewhere. Does it have something to do with the fire input not replicating?

You should have ticked “Replicate” checkbox in Projectile blueprint details. Also replicate fire event from client to server.
Try to watch this stream if you have any further issues: