Announcement

Collapse
No announcement yet.

replication issue with spot light component

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

    replication issue with spot light component

    Im having an issue with getting the spot light in mycharacter blueprint to replicate its rotation the following pictures is my set up.

    Click image for larger version

Name:	sync issue with flash light.png
Views:	1
Size:	125.1 KB
ID:	1213681

    Click image for larger version

Name:	sync issue with flash light1.png
Views:	1
Size:	89.4 KB
ID:	1213682

    Click image for larger version

Name:	sync issue with flash light3.png
Views:	1
Size:	78.9 KB
ID:	1213683

    Click image for larger version

Name:	sync issue with flash light4.png
Views:	1
Size:	3.8 KB
ID:	1213684


    not seeing what im doing wrong here. If any one has any idea what im doing wrong please enlighten me. Because im kinda stumped on this part. i have tried both with and with out a rpc and also have all components set to be replicated as well. Also i have tried with and with out the function. by calling each var from the player character pin from the rpc instead of the function . Any info on this would be great! Thanks in advance!

    #2
    First of all, you don't need to tell server that you rotated, the server already knows if you did. Second, "Get Control Rotation" will not give the correct data because this rotation comes from player controller, and each player controller is only relevant to the owner.
    If you want my advice, disable the component replication, make a float variable in your character called "Controller Pitch", and on event tick, make check if it's the server running the code (Branch and "is server"), set the "Pitch" value. For the "Pitch" value use "Get Controller Rotation" and break it, and get it's Y and connect it to the "Pitch". Make the "Pitch" variable replicated, and on "Replication condition" select "Skip owner". Then, on "Event Tick", make a branch and check if the player is locally controlled. If not, update it's rotation using your function "Flashlightmovement". Just replace the "Get Control Rotation" with your new "Pitch" variable.

    Comment


      #3
      Originally posted by DjSt3rios View Post
      First of all, you don't need to tell server that you rotated, the server already knows if you did. Second, "Get Control Rotation" will not give the correct data because this rotation comes from player controller, and each player controller is only relevant to the owner.
      If you want my advice, disable the component replication, make a float variable in your character called "Controller Pitch", and on event tick, make check if it's the server running the code (Branch and "is server"), set the "Pitch" value. For the "Pitch" value use "Get Controller Rotation" and break it, and get it's Y and connect it to the "Pitch". Make the "Pitch" variable replicated, and on "Replication condition" select "Skip owner". Then, on "Event Tick", make a branch and check if the player is locally controlled. If not, update it's rotation using your function "Flashlightmovement". Just replace the "Get Control Rotation" with your new "Pitch" variable.
      cool thanks for the info ill try it tomorrow.

      Comment


        #4
        That implementation helps a lot. Worked really well. thanks

        Comment


          #5
          Originally posted by DjSt3rios View Post
          First of all, you don't need to tell server that you rotated, the server already knows if you did. Second, "Get Control Rotation" will not give the correct data because this rotation comes from player controller, and each player controller is only relevant to the owner.
          If you want my advice, disable the component replication, make a float variable in your character called "Controller Pitch", and on event tick, make check if it's the server running the code (Branch and "is server"), set the "Pitch" value. For the "Pitch" value use "Get Controller Rotation" and break it, and get it's Y and connect it to the "Pitch". Make the "Pitch" variable replicated, and on "Replication condition" select "Skip owner". Then, on "Event Tick", make a branch and check if the player is locally controlled. If not, update it's rotation using your function "Flashlightmovement". Just replace the "Get Control Rotation" with your new "Pitch" variable.
          tried it this way and it does nothing for me. it will and has always rotated left and right its the pitch that is not rotating. the way i had it set up originally allows for the pitch to rotate but then it resets back to the original position right after not sure why. even tried doing this with a replicated actor but i get the same results works left and right an thats it. not gettign any pitch values to work for components when trying to network sync the pitch rotation of the component. so any more help on this would be great!.

          Comment


            #6
            Maybe get the Z instead of Y from the "Get Control Rotation"

            Comment


              #7
              ok so i got it to work finally and it works just right. got my info from here Pitch rotation info but instead of controller rotation i used the world rotation from my camera since im dealing with first person.
              [MENTION=224171]DjSt3rios[/MENTION] ty for the advice!

              Comment

              Working...
              X