Download

Replication help. Weapons Duplicate on server....(Video Included)

So I have been able to replicate all of my functions thus far on both the server and the client including my weapon equip function. The problem I have run into is that the weapons seem to duplicate on the server and I cannot seem to figure out why. I have spent roughly four hours trouble shooting on my own and have decided to finally ask for some help. I am a beginning developer and have only completed my first year of computer science so I’m hoping someone can point me in the right direction. I have posted a video and if anyone is willing to help maybe we can connect through email or skype so I can share more information on what is involved inside the functions to get a better idea of what could be causing the problem. Thank you in advance for any helpful advice.

The Begin Play event will run both on server AND the client.

When you call a Run on Server event and right after a Run on Client event, you are telling to “If you are a server, run. Right after, run this only on your local machine”

Considering this, if you are a server, you will run both events. That’s the reason you’ll spawn twice your gears.

** To avoid this, you would check if the weapons you spawn are marked as “Replicates”, and then ONLY spawn (inside your character class) on server-side, on Begin Play.

Thank you so much! I didn’t even think to validate if the weapons were already being replicated on the server. Fixed it with a simple validate and a branch. I hope this helps someone else who has run into a similar problem. I am all about sharing the knowledge. Here is what my begin play looks like now.