Weird Bug in my Multiplayer Project!

Hello all! I’m here to ask a question, as I’m not too well versed in Replication and Multiplayer just yet.

I’m trying to make a Multiplayer FPS which has an energy system in place of ammo. So, far, that’s what I’ve developed. However, it seems that now when I try shooting, it restarts the game but I can’t see the other players.

Upon further investigation, it seems whenever I try shooting the weapon in the client (not the host), it puts the client in another server as the host, which is most likely why I don’t see the other player in the original host’s game at all. After that “restart” happens, however, I can freely shoot and move around in this alternate server. So, while everything does seem to work fine, I’d rather be able to shoot and move around in just one server rather than have the engine decide to put the other players in a separate client.

I don’t have any full leads to how it could happen, but I do a running theory that me referencing the FirstPersonCharacter variable (which was already packaged in when I did the First Person Template) so much in my code led it to causing some issues server-side.

I do have an idea on how to fix it, but that would involve me moving all of the shooting functions to the FirstPersonCharacter blueprint, and even then I don’t know if that would fully fix it.

If anyone has any ideas, please let me know! I will also post a few images of my code so that people can get a sense of what’s happening.




I solved this by just moving my shooting script into the FP Character Blueprint itself, rather than having the weapon do all the shooting. I’d still like to see someone resolve this by using the Weapon Component Blueprint instead, however. I am happy, though, with just using the FP Character Blueprint for the time being.