Download

Replication is not working for weapons equip from inventory

i need a tutorial for replication

1 2 3 4th pics is in my character bp

5 and 6th pic is in my anim bp

7th pic is in Widget bp







fe6b9fca1f0a14b3729e9b6d4cd4c59bfe680573.png

You need to specify what exactly is your problem instead of throwing all your bps here and expect us to guess what’s wrong. Replication is not a simple topic.

There’s a lot of tutorials about unreal engine replication on youtube.

https://www.youtube.com/results?search_query=unreal+engine+replication&page=&utm_source=opensearch

i played multiplayer with 2 player in dedicated server when i equip weapon from client 1 it is not showing in client 2

Is the Gun-actor being replicated? You can do this by selecting the root in the Blueprint. Make sure to check “Replicates” and “Replicates Movement”.

it dint work

When you start equipping you must call it from the server, to replicate to all clients:

Start equip -> Switch Has autorithy -> Authority -> Start equipping
______________________________ -> Remote -> Call Event that executes on server and that calls Start equip again -> Start Equipping

My suggestion is that you take some time to understand how the Server events and Multicast works and follow examples on youtube, testing with simple projects, before start venturing yourself in specific implementations.

You can start by looking how he made the logic in this part of the video to replicate correctly.

check this video, too, for an overview.

Okay thx for the info

i followed that video but i cant fix mine but now it is playing in sever and showing the weapon in sever player in client but it is not equiping gun in client i am using switch autority

Show us what you’ve modified.

Have you tried avoiding Multicast and making something similar to this:

As you can see, my Event Server Equip Weapon is not multicasting, it is set to “Run on server”.

Another thing you should notice is that, as a Remote client, even after calling the Server Equip Weapon I pinned to Equip Weapon function in the sequence, for the client to run properly inside itself the animation, sound and effects that comes after. Otherwise it would run to everyone excepts to itself.

now i played with deciated server off with 2 player if i equip weapon in server the weapon i choose there is only can be switched in client player too see the pic but i cant play with deciated server on it is not equiping weapon 1a,2a,3a,4a,5a pics are in my character bp the variables in that pic is replicated the other pics are in widget bp

i followed this 2 tutorials

Pls tell me how to fix that

0af627cea468cac520c81038ef474a726659a7c0.png
c0a1b49ac64781804f2a61f73fb2b2db40373bef.png
a0211551f076fb8f6799ea4740be063e16c3cd6d.png
2550e16f78b4902f54c139042d2ca1991aecac26.png
6cdf175a6dfd22a7b6a6a1c713543173ec09bed4.png








Didn’t get exactly what is your problem by your description, but try to make the same way I showed you, in the last picture, just after the InputAction WeaponSlot1 and test it.

You can always debug or print in any part of the code to see which client(Server or Local) is calling the events/functions, like printing whenever you call the Equip Weapon function to see if the Server or the client is calling it.

if i run dedicated server with 2 players i cant equip weapon it is opening the inventory and if i selecte 3 weapons and it is not showing the equiped weapon in the character hand

see the pics above for my bps

or can you see that both tutorial i mention above and tell me how to make it work with multiplayer

Did you try printing/debugging to find where the replication problem starts?

Did you try making your logic like in this pic?

yup i did like that

my problem is it is taking the weapon which i choose in server and equiping it in server character & in client character

Probably because your backpack variable is being taken from the server.

Try this:
Send your Backpack Weapons variable as an input parameter to SpawnWeaponsAndAssignSlots function, and don’t forget to include it in the Spawn Weapons and Assign Slots on Server event, too. What I see is that you are always using the Server Game instance reference, maybe if you send it via parameter to the function you will send correctly.