Child actor not replicating correctly with AttachToComponent

So here is a weird issue: I got a child actor that Attaches to Component in the construction script. Everything attaches correctly on the server/splitscreen, but connecting clients see the child attached quite a bit further away. The child still follows the parent’s location, it just seems the initial attach point is ‘up in the air’ for clients.

These two screenshots are in-game at the same time:

Here is the construction script and hierarchy:

234679-heirarchy.jpg

Also notable, the floating UI is in 3D space and next to the gun but isn’t impacted by the weird offset. The other attach, which mounts the camera to a socket is working correctly.
I have attempted:

  • Changing the location rule in the ‘AttachToComponent’
  • Running the ‘AttachToComponent’ manually after client load in
  • Running the ‘AttachToComponent’ via the server manually after client load in

No matter what I do, the clients will always see the child actor attached differently than the server, but they still replicate correctly otherwise.

For some slight context: I’m using a child actor for the guns as I have a Borderlands-esque randomized gun system.

Is there something obvious that I’m missing?

Alright this one was a bit weird and I’m somewhat convinced it might be a bug:

The child actor component had a static mesh, that, when replication was on, would throw the whole child actor into seemingly random locations. (But only for the client)

If replication was off, the child actor would be in the right location but the mesh wouldn’t get the message to spawn in the static mesh, so it was invisible.

To ‘solve’ this, I put the static mesh in another blueprint with replication turned on, and then used it as a child actor within the child actor.

So it's like this:
(This won't work correctly)
- Player
   - Child Actor
      - Static Mesh (When static mesh has replication on)

But:
(This works correctly)
- Player
   - Child Actor
      - Child Actor (Replication on within class, but not on as a child actor)
         - Static Mesh 

I’m sorry this is weird and if its explained poorly, but I hope this helps someone if they run into this issue.

I just had to deal with this. wasted a lot of time.
thank you. glad i found this.
this has to be a bug. please fix Epic.

edit using 4.20.3

WOW. This fixed my issue. It makes no sense but I’m glad you took the time to post and explain it clearly with the hierarchy.

First post here…
This issue still occurring in 2022.
For more details please review below:

  1. I have a flashlight actor that I spawn on the SERVER via an actor component in a player character. The flashlight is then ATTACHED to a bone on the owner of the actor component’s skeletal mesh.

  2. The flashlight actor is set to REPLICATES and REPLICATE MOVEMENT.
    ^ Actor is comprised of a spotlight and a static mesh.

Issue:

If ANY component of the flashlight actor in the hierarchy ABOVE a static mesh (or if the static mesh itself) is set to ‘component replicates’, the attachment fails ONLY FOR THE CLIENT.

SOLUTION:
Do not set any component for an attaching replicated actor to ‘component replicates’