Announcement

Collapse
No announcement yet.

Replication is not working for weapons equip from inventory

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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
    Click image for larger version

Name:	1.jpg
Views:	1
Size:	120.9 KB
ID:	1182825
    Click image for larger version

Name:	2.png
Views:	1
Size:	194.8 KB
ID:	1182826
    Click image for larger version

Name:	3.png
Views:	1
Size:	171.3 KB
ID:	1182827
    Click image for larger version

Name:	4.png
Views:	1
Size:	149.9 KB
ID:	1182828
    Click image for larger version

Name:	5.png
Views:	1
Size:	99.3 KB
ID:	1182829
    Click image for larger version

Name:	6.png
Views:	1
Size:	121.8 KB
ID:	1182830
    Click image for larger version

Name:	7.png
Views:	1
Size:	82.9 KB
ID:	1182831

    #2
    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?sear...rce=opensearch

    https://wiki.unrealengine.com/Replication

    Comment


      #3
      i played multiplayer with 2 player in dedicated server when i equip weapon from client 1 it is not showing in client 2Click image for larger version

Name:	8.png
Views:	1
Size:	759.7 KB
ID:	1106926

      Comment


        #4
        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".

        Comment


          #5
          it dint work

          Comment


            #6
            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.

            Comment


              #7
              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.

              Comment


                #8
                Okay thx for the info

                Comment


                  #9
                  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

                  Comment


                    #10
                    Show us what you've modified.

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

                    Click image for larger version

Name:	2222.jpg
Views:	1
Size:	137.5 KB
ID:	1107018

                    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.

                    Comment


                      #11
                      Originally posted by Gbr View Post
                      Show us what you've modified.

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

                      [ATTACH=CONFIG]94837[/ATTACH]

                      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/0...ate-inventory/


                      http://shootertutorial.com/2015/06/0...ics-equipping/



                      Pls tell me how to fix that
                      Attached Files

                      Comment


                        #12
                        Click image for larger version

Name:	1a.png
Views:	2
Size:	245.5 KB
ID:	1107085
                        Click image for larger version

Name:	2a.png
Views:	2
Size:	334.8 KB
ID:	1107086
                        Click image for larger version

Name:	3a.png
Views:	2
Size:	300.7 KB
ID:	1107087
                        Click image for larger version

Name:	4a.png
Views:	2
Size:	11.1 KB
ID:	1107088
                        Click image for larger version

Name:	5a.png
Views:	2
Size:	362.0 KB
ID:	1107089
                        Click image for larger version

Name:	6a.png
Views:	2
Size:	450.2 KB
ID:	1107090
                        Click image for larger version

Name:	7a.png
Views:	2
Size:	453.9 KB
ID:	1107091
                        Click image for larger version

Name:	construct.jpg
Views:	2
Size:	48.2 KB
ID:	1107187
                        Click image for larger version

Name:	createbackpack.jpg
Views:	2
Size:	298.4 KB
ID:	1107188
                        Click image for larger version

Name:	focusdisp.jpg
Views:	2
Size:	49.6 KB
ID:	1107189
                        Click image for larger version

Name:	getfirstfreeslot.jpg
Views:	2
Size:	151.5 KB
ID:	1107190
                        Click image for larger version

Name:	itemclickedinselectedweapons.jpg
Views:	2
Size:	138.3 KB
ID:	1107191
                        Click image for larger version

Name:	iteminbackpack.png
Views:	2
Size:	72.8 KB
ID:	1107192

                        Comment


                          #13
                          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.

                          Comment


                            #14
                            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

                            Comment


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

                              Did you try making your logic like in this pic?

                              Click image for larger version

Name:	123123123.jpg
Views:	1
Size:	142.2 KB
ID:	1107271

                              Comment

                              Working...
                              X