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!
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!.
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. @DjSt3rios ty for the advice!