x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

AttachRootComponentTo Replication Bug

Hello,

Apparently, there is an issue in AttachRootComponentTo(), that it does not replicate actors correctly to clients.

More details of this bug can be seen _on this forum topic_. Also, I found out that _there's a Hack in UT source code to allow this replication_ (I don't understand it very well, thought I haven't inspected it deeply).

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 :)

Thank you in advance!

Product Version: UE 4.7
Tags:
more ▼

asked May 29 '15 at 01:03 AM in Bug Reports

avatar image

Zoc
188 16 15 24

avatar image Ben Halliday STAFF May 29 '15 at 03:14 PM

Hi Zoc,

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 the download link? Which version of the engine are you using? You mention UT... is this a UT Editor bug, or are you using the UE4 source?

avatar image Zoc May 29 '15 at 07:53 PM

Hello Ben,

This is the source code I'm using. The only check in there that's not compatible with the default UE4 code is the team check, which can easily be removed and has no impact in this issue.

This is what I'm doing and what's happening:

  • 1) Use that code and add a blueprint

  • 2) Change Blueprint FlagMesh component to an actual Mesh

  • 3) Drag and drop the blueprint into the level (the previous numbers are trivial, but I decided to describe them anyway)

  • 4) Start the game in "Play-In-Editor" mode with number of players = 2 (I tried with 3 too)

  • 5a) If I move the "listen server" player (editor one) through the flag, it gets and attach the flag (I can see it's shadow easily). The client doesn't see any change.

  • 5b) If I move the client through the flag, the flag doesn't disappear from the ground, BUT the "listen server" (editor) see the client player carrying the flag (attached to him) and the flag disappears from the ground.

I've tried calling AttachRootComponentTo() from a bunch of places. Right now, it gets called inside a RPC + NetMulticast call, started with the 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 the 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 the team check, and post it here.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I'm sorry Ben!

Apparently this was a problem on my side. For some reason, my Blueprint replication value was disabled even when I explicitly enabled it in the 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 the problem was on the blueprint. I'm really really sorry for this.. Can't believe it took this long to find it. :(

more ▼

answered May 29 '15 at 10:59 PM

avatar image

Zoc
188 16 15 24

avatar image Ben Halliday STAFF May 30 '15 at 03:53 PM

No problem, I'm glad you found the solution! I'll go ahead and resolve this post, then.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question