I tried testing my source code on UE4.8P4, but I hit this conversion bug.
Since I couldn’t find an UT-XXXXX bug report, I’m reporting this here. Hopefully ir’s not a duplicate of another bug already reported.
I’d like to assist in this bug, to help reproducing it, etc. It’s something I really would love to see fixed
As far as I know, there isn’t any problem with replication after using AttachRootComponentTo(). Can you describe exactly what’s happening, and how you’re trying to use it? Where are you calling AttachRootComponentTo() from, and are all Actors involved set to Replicate and Replicate Movement?
Are you able to reproduce this in a new project? If so, would you mind uploading that test project somewhere and getting us download link? Which version of engine are you using? You mention UT… is this a UT Editor bug, or are you using UE4 source?
This is source code I’m using. only check in there that’s not compatible with default UE4 code is team check, which can easily be removed and has no impact in this issue.
This is what I’m doing and what’s happening:
Use that code and add a blueprint
Change Blueprint FlagMesh
component to an actual Mesh
Drag
and drop blueprint into level
( previous numbers are trivial,
but I decided to describe them
anyway)
Start game in
“Play-In-Editor” mode with number of
players = 2 (I tried with 3 too)
5a) If I move “listen server” player
(editor one) through flag, it
gets and attach flag (I can see
it’s shadow easily). client
doesn’t see any change.
5b) If I move
client through flag, flag
doesn’t disappear from ground,
BUT “listen server” (editor) see
client player carrying flag
(attached to him) and flag
disappears from ground.
I’ve tried calling AttachRootComponentTo() from a bunch of places. Right now, it gets called inside a RPC + NetMulticast call, started with OnOverlapBegin() method.
This is an UE4.7 bug. I decided to take a look on UT source code (since it has a CTF mode) to see how it works and I stumbled across this piece of code, inside UTCarriedObject.h, where it describes there’s an actual bug in engine code.
// workaround for bug in AActor implementation
virtual void OnRep_AttachmentReplication() override;
// HACK: workaround for engine bug with transform replication when attaching/detaching things
virtual void OnRep_ReplicatedMovement() override;
I’ll add this flag to a new project, minus team check, and post it here.
Apparently this was a problem on my side. For some reason, my Blueprint replication value was disabled even when I explicitly enabled it in constructor.
My apologies
Edit: I think I should clarify on this:
I created a new project and it worked.
Then I started stripping my project to find out what was wrong.
When I moved an asset from one project to another, it failed.
Using a diff tool I could pinpoint that problem was on blueprint.
I’m really really sorry for this… Can’t believe it took this long to find it.