Announcement

Collapse
No announcement yet.

Projectile Replication.

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

    Projectile Replication.

    Hello, Ive been trying for a while to get my projectiles to replicate for multiplayer. I watched the unreal tutorials for networking but still dont understand how to do it. Can someone please explain it and help me figure this out thanks.

    #2
    Can anyone help me figure this out?.

    Comment


      #3
      Its kind of strange but what you need to do is create a custom event then set it to run on server. Point the custom event to your projectile function.

      Then call the event from where you were calling your projectile function from before.
      - Russell Meakim AKA The Castle
      BLOG: https://steemit.com/@thecastle

      Comment


        #4
        I'm a little confused. I have Input Action Fire Running my function. Do i just have the custom event go to the same place the Fire function does and have the Custom function at the end of my fire function?.

        Comment


          #5
          Should be similar to C++, which is SetReplicates.
          Rule#21: Be polite, be professional, but have a plan to kill everyone you meet.

          Comment


            #6
            I have not done c++ i have only used blueprint.

            Comment


              #7
              Hey, input events are only fired on the local player, so if want to spawn something when you click your mouse you need to call an event that replicate on server (run on server, reliable). You need to do the things that you want to replicate on the server or it will not work.

              Comment


                #8
                Ok, I set a custom event "Fire" and have it play when i left click. Now the server sees the projectile but the client doesn't?. Does anyone know why.?

                Click image for larger version

Name:	557068289720615f3e7fb49ac908f4b2.png
Views:	1
Size:	129.6 KB
ID:	1067910

                Comment


                  #9
                  The actor(your projectile) that you spawn need to have replicates and movement replicate checked inside his default proprieties.

                  Comment


                    #10
                    It is set to replicate but it does not show up on the client just the server now.

                    Comment


                      #11
                      Have your input button (Left Click) for firing the weapon call a custom event. Set the custom event to Run on Server. Click image for larger version

Name:	e4a93a42bbd1bf20fd0f29ab1b3c214a.png
Views:	1
Size:	10.3 KB
ID:	1067923

                      Should look like this.
                      Click image for larger version

Name:	3b3c6127778524eba0eb5bd2d7fc85ab.png
Views:	1
Size:	120.6 KB
ID:	1067924
                      http://bradon.myportfolio.com

                      Comment


                        #12
                        Oh, i missed a detail in there and see that you did something like this. Hmmmmmmmmmm This exact set up is working for me.

                        Click image for larger version

Name:	4bbc0af7dc6857d63971926bd8eb6e7a.png
Views:	1
Size:	13.0 KB
ID:	1067925

                        You did this right? This is inside the projectile BP
                        Last edited by Demeese; 03-08-2015, 12:46 AM.
                        http://bradon.myportfolio.com

                        Comment


                          #13
                          Yeah thats how i have it setup but for some reason it does not appear that i hit something. Inside my projectile i have a hit result that spawns an emitter and i cannot see the emitter spawn when the projectile hits on the client side.Also for some reason in the server side the hit is off for some reason. I shoot 1 place in the client it it displays like 5 feet to the left of where i shot on the client.
                          Last edited by Firezown; 03-08-2015, 02:25 AM.

                          Comment


                            #14
                            I still cannot get the projectile to show on the client. Its only showing on the server and not even in the right spot.

                            Comment


                              #15
                              Spawning of the particle will also have to have the same kind of replication applied to it. Needs to be called by the server.

                              Something sounds seriously screwy with the way you have it set up. Especially when I hear that things aren't even showing up in the right place. You may have some of the spawn transform properties messed up as well. A good practice would be just to start over and make sure you understand how everything is working.
                              http://bradon.myportfolio.com

                              Comment

                              Working...
                              X