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







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

http://shootertutorial.com/2015/06/06/how-to-create-inventory/

http://shootertutorial.com/2015/06/08/how-to-add-weapons-basics-equipping/

Pls tell me how to fix that




4a.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.