Download

Child component not replicating

Hello everyone, I have a pistol attached to my character’s camera, and in single player, I can look up & down just fine, and my pistol remains in the center of the screen (it moves up when the player looks up), but in multiplayer, players can only see their own pistol move up & down, but when they look at other players, their pistols seem to have a constant pitch of 0. I have tried quite a few ways to get my pistol’s angle to replicate, and it seems as if the reason it is not replicating is that the camera’s pitch is always 0. Something that I have done that works is to detach my pistol from my camera, and every tick, set my pistol’s relative pitch to the pitch of Get Control Rotation, but this is not smooth movement, it’s jumpy. Something that also works is if I check the box “Use Control Rotation Pitch” in my character’s detail panel, the problem with this is that my whole character mesh moves with the pistol. What is the best way of going about having my pistol follow the player’s pitch look, and have it replicate?

Alright, I’ve got an awesome fix for this that works great. I’ve attached a Scene Component to my camera, and my pistol to the Scene Component, and on my Look_Up_Down input, I set the relative rotation of my Scene Component to be that of my Control Rotation, but only if the pawn is not locally controlled.