Hello,
I’m currently working on a relicated Stationary Weapon system. Something the like of MG Nest, Anti Air Cannons and so on which fires from their actual muzzle location and no other trickery involved.
It all works great in Singleplayer nad more or less replicatess in Multiplayer. However I’m running into an issue I know where it stems from. But my brain does not come around to the solution. I’m hoping posting it will enlight me directly or someone could help me
My Setup is the following in Blueprint:
-
Pawn Actor (replicated, Replicated Movement Deactivated to achieve Compatibility with SmoothSyncPlugin)
-
Smooth SDync is enabled.
-
I have 2 Scene Components under the RootComponent: RotationRoot_Yaw and RotationRoot_Pitch
(This is done so I can easily add in static meshes or skeletal meshes and can control the base rotations of the independendly and do not need to rly on AnimBP). -
On Input LookUp and Look Right I set a replicated Variabls Weapon_Yaw and Weapon_Pitch.
-
On Event Tick I interpolate betwewn the current relative yaw or pitch and the new relative yaw or pitch and set the relative rotations for both components.
The Issue:
As the Variables are Server Sided, We get the values with a slight delay as a client and it stutters depending on the connection quality. As the weapons shoot from their correct muzzle locations. This has to be the case.
I tried to calculate with local variables but this causes missmatch with the server and I can’t find a smooth way…