Actor attached to Pawn is not always relevant

Hey all,

My team is running into an interesting problem. We are attaching a Weapon (a blueprint actor) to a pawn during runtime, marked as replicated, always relevant, and with replicated movement (it uses a projectile movement component). During play, when a client is close to the server, the client is able to throw the Weapon without any issue.
However, as soon as the client leaves its close proximity to the server pawn, the throw starts acting strangely. Its trajectory and velocity are accurate, but its rotation is off, and always angled incorrectly.

As we prepare the weapon to be thrown, we are updating its local rotation and location, as seen here:

I’m not quite sure if locally rotating and shifting the weapon while outside of the server’s range is causing this issue, but I’ve exhausted most of my other ideas.

By printing debug lines of the weapon’s transform, it’s pretty clear that within server range the weapon is replicating its transform correctly to the server, but as soon as its out of range the transform is now different between client and server.

Any help would be appreciated. It seems there’s something I’m missing about attached actor replication.

Bump.

I have a similar issue. I’m creating a BP_Corpse to save a “static” mesh of a ragdoll’s pose after the character has died in order to save on the physics simulation. This is to try to freeze a corpse in its pose so that it can persist on the map. For some reason, if the character dies and they are out of range of the server, the pose is never saved and I see an arbitrary pose from the character’s animation state machine.

I set the BP_Corpse to be “Always Relevant” but this doesn’t seem to fix it. Is there something about Always Relevant that is NOT what it seems to be? Very perplexed by this and I think it fits right in with OPs question.

After some more testing I’ve discovered that by attaching the weapon to a scene component in the pawn blueprint, everything works fine. Previously I had attached the weapon to the pawn’s right fist hitzone, which is a capsule collider. Does attachment to a collision sphere effect this in any way?

It seems the solution was the not attach the actor to a collision component. Still unclear on why this is the case, but I’ll mark this as closed.

I’m having a similar issue and it seems to be related to attaching to anything that isn’t the parent component. Mesh, collision or any child. Seems to be even more of an issue if that child component is animating via being parented to a socket within a skeletal mesh.

Animations are not updated on server by default, so if the weapon’s parent is a bone or socket that changes transform with animations, it won’t match the server transform, which is static unless you set VisibilityBasedAnimTickOption to Always Tick and Refresh Bones on the skeletal mesh that owns the weapon. But that incurs the cost of processing animations on the server.