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:
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:
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?
asked Mar 22 '18 at 10:14 PM in Blueprint Scripting
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.
I'm sorry this is weird and if its explained poorly, but I hope this helps someone if they run into this issue.
answered Apr 07 '18 at 11:44 PM
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.
answered Feb 04 '19 at 03:45 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here