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. 

AttachRootComponentToActor crashes multiplayer game

In Singleplayer mode it works fine but when I execute: PickupItem->AttachRootComponentToActor(this, "Socket_Root", EAttachLocation::SnapToTarget); while in multiplayer, the game crashes and triggers a breakpoint at the following line in SceneComponent.cpp:

 // Make sure parent points to us if we're registered
         checkf(!bRegistered || AttachParent->AttachChildren.Contains(this), TEXT("Attempt to detach SceneComponent '%s' owned by '%s' from AttachParent '%s' while not attached."), *GetName(), (GetOwner() ? *GetOwner()->GetName() : TEXT("Unowned")), *AttachParent->GetName());

Maybe I'm too tired but I can't find the problem.

EDIT: The Problem still persists in 4.8 and the following error pops up:

 Script Stack:
 Assertion failed: !bRegistered || AttachParent->AttachChildren.Contains(this) [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.8\Engine\Source\Runtime\Engine\Private\Components\SceneComponent.cpp] [Line: 1335] 
 Attempt to detach SceneComponent 'Environment Mesh' owned by 'Shabby_Pants_C_0' from AttachParent 'CharacterMesh0' while not attached.

It happens when I spawn a player and instantly attach a bunch of gear-items to him as soon as he logs onto the server. When the game is already in progress, the very same command doesn't cause any issues.

Product Version: UE 4.8
more ▼

asked Mar 05 '15 at 11:44 PM in Bug Reports

avatar image

421 38 47 143

avatar image Pseudocorpus Apr 01 '15 at 07:30 PM

I narrowed it down a little bit by writing a function in my pickup-class. The "AttachRootComponentTo"-Function inside this function is causing the crash.

 void ASomPickup::AttachToCompSocket(USceneComponent* Comp, FName Socket)
     //Disable Physics
     //Disable Collision
     //Attach Pickup to Socket
     this->AttachRootComponentTo(Comp, Socket, EAttachLocation::SnapToTarget);

As I said. In singleplayer it works fine. In multiplayer the game crashes. Does anybody have a suggestion?

avatar image Doug E ♦♦ STAFF Apr 01 '15 at 07:43 PM

Hey Braindrain85-

I am investigating your crash and would like to ask for some additional information. In multiplayer does the crash occur as soon as you begin playing or when when the lines of code you posted are called (when you attempt the attach)? Could you post the log files from the crash as well as the code for the class where you are trying to call AttachRootComponentTo()?


Doug Wilson

avatar image Pseudocorpus Apr 01 '15 at 08:09 PM

Hey Doug. Thanks for answering.

The crash doesn't happen until I call the function (from my Character class). But the function gets called immediately after spawning the character.

avatar image Doug E ♦♦ STAFF Apr 07 '15 at 09:09 PM

Hey Braindrain85-

It's most likely that comp is NULL when the call happens which is what is causing the breakpoint to trigger. Adding in a check() to ensure that it is not null (and handling it if it is) should sold the issue.


Doug Wilson

avatar image Pseudocorpus Apr 07 '15 at 10:49 PM

Hey Doug,

thanks again for your answer and your efforts regarding this matter.

I wrote a check at the beginning of the function:

 if (Comp == NULL)
         print("Comp == NULL!");

...but it is never being called. After that I wrote the following:

 if (Comp != NULL)
         print("Comp is Null");

But it is always printing "CharacterMesh0"... so the component is never NULL :-(


avatar image Tim C ♦♦ STAFF Jun 16 '15 at 07:26 PM

Hi Braindrain85,

I had some questions for you regarding this issue.

  • Just to confirm, this is only occurring when you are testing your game in multiplayer, and only at the very beginning of the game, correct?

  • Is this happening in PIE, or in a packaged version of your game?

  • Could you provide the full crash report that is shown when the crash happens? I tried to find a submitted report matching the error you provided but was unable to do so.

  • Are you able to reproduce the crash in a new test project?

  • Would it be possible to see the code for your pickup and character classes?


avatar image Pseudocorpus Jun 17 '15 at 04:32 PM

Hey Tim. Thank you very much for your answer.

  • Yes, it is only happening in multiplayer and only at the beginning of the game.

  • The error occurs in PIE as well as in the packaged version.

  • Here is the crash report: link text

It would be a little complicated to reproduce this in a new project, because there are a lot of classes working together:

The Networking-Class receives a string from a SQL-database and sends it to the Character-class ("LoadAppearance_Complete") to cut it into chunks and set the equipment of the character. Then the GameMode iterates through all the players, synching each one to the other with a function inside the Character-class.

The Character-class has a number of functions which are calling the "Attach"-Function inside the Pickup-Class so it is hard to say which function triggers the error.

But nevertheless, here is the entire code of my project. Consider that some events are triggering blueprint "code". I hope you can help me.

[link text][2]

avatar image State128 May 17 '16 at 02:29 PM

Hi, I have the same problem in a multiplayer Dedicated game, running on 4.11 latest. Both packed games and in PIE. 1) Detach item(actor) on server 2) Client freeze(could be up to 40 sec !!!) and stacktrace as below:


Script Stack: Actor.OnRep_AttachmentReplication

[2016.04.26-12.57.56:994][947]LogStats: FPlatformStackWalk::StackWalkAndDump - 0.723 s [2016.04.26-12.57.56:994][947]LogOutputDevice:Warning: === Handled error: ===

Ensure condition failed: !bRegistered || AttachParent->AttachChildren.Contains(this) [File:D:\BuildFarm\buildmachine_++UE4+Release-4.11\Engine\Source\Runtime\Engine\Private\Components\SceneComponent.cpp] [Line: 1655] Attempt to detach SceneComponent 'LootCollisionSphere' owned by 'Shotgun_C_3' from AttachParent 'CharacterMesh0' while not attached. Stack: UE4Editor-Core.dll!FWindowsPlatformStackWalk::StackWalkAndDump() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\core\private\windows\windowsplatformstackwalk.cpp:178] UE4Editor-Core.dll!FDebug::EnsureFailed() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\core\private\misc\outputdevice.cpp:317] UE4Editor-Core.dll!FDebug::OptionallyLogFormattedEnsureMessageReturningFalse() [d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\core\private\misc\outputdevice.cpp:441] UE4Editor-Engine.dll!USceneComponent::DetachFromParen[2016.04.26-12.57.56:996][947]LogStats: SubmitErrorReport - 0.000 s [2016.04.26-12.57.57:452][947]LogStats: SendNewReport - 0.455 s [2016.04.26-12.57.57:452][947]LogStats: FDebug::EnsureFailed - 1.182 s

When i can initiate it from the client i always detach first on client, that seems to work. But the problem is when the server is the "Initiator"


avatar image Tim C ♦♦ STAFF May 20 '16 at 08:19 PM

Hi State128,

Are you able to reproduce this issue in a new, clean project, or does it only happen in your project? Just to be sure, when you detach a component on the Server, are you making sure that when the client is notified to detach the component it isn't turning around and telling the server that the component needs to be detached?


avatar image State128 May 25 '16 at 09:23 AM

Hi, after a chat with you guys at Nordic Game i changed approach. I think it works well now. What I did when dropping an item is to kill the item and create a new item (as a pickup). Then it seems to work. It could be a problem when changing owner of the actor and detach the Component. Anyways, works for me now. Thanks for your attention.

avatar image Pseudocorpus Jun 25 '15 at 07:43 PM

UPDATE: It seems that the cause isn't any of my functions but the native Attachment Replication of UE4.

The following scenario appears to trigger the crash: There is already a player on the server and has attached some items to his body. The crash happens while another player joins the server.

This is the call stack: alt text

callstack.jpg (144.7 kB)
avatar image Tim C ♦♦ STAFF Jul 01 '15 at 04:15 PM

Hi Braindrain85,

I have a project setup that I think is close to what you have when you see this crash occur. I have two sockets on a player character, and on begin play I attach an instance of an actor class to each socket using the AttachToCompSocket code you provided above. Unfortunately I did not see a crash when I tested this in a few different multiplayer tests, so I am still missing something. Would it be possible to see the entire code for your character class and the class you are attaching to the character?


avatar image Pseudocorpus Jul 01 '15 at 05:16 PM

Hey Tim,

I have sent you a PM with the code on the forums.

avatar image Tim C ♦♦ STAFF Jul 02 '15 at 10:12 PM

Thanks. I got it and built a project with your code. I'll take a closer look at the code next week, and see if I can get the issue to happen for me.


avatar image Pseudocorpus Jul 03 '15 at 03:00 PM

Thanks a bunch, Tim! If you like, I can send you the whole project, too... so you don't have to fiddle around with the "content-includes" in the constructors.

avatar image Janyx Jul 14 '15 at 04:44 PM

Did you by chance figure out what the issue is? I am having the exact same problem. Thanks!

avatar image Pseudocorpus Jul 14 '15 at 11:34 PM

Not yet. I've just sent my whole project to Tim with a PM on the forums. Hopefully he is still reading this.

avatar image Tim C ♦♦ STAFF Jul 15 '15 at 04:12 PM

Hi everyone,

I apologize for the delay on this issue. I have been a bit swamped for the past couple weeks, and still have around 20 issues that I am looking into. This particular issue is one I will try to prioritize as best as I can.


avatar image Tim C ♦♦ STAFF Jul 27 '15 at 08:24 PM

I started looking into this issue in depth on Friday, and then some more today. I can see the crash happening, but have not yet determined why it is happening. I did have a couple questions for you:

  • I noticed that the repro steps involve starting with a male character, putting on the supplied clothing items, then joining as a female character that is already wearing the items. No crash occurred if I did not put on any of the clothing items before having the second character join. If you reverse the order that the characters join, does the crash still occur?

  • What happens if you start with a clothed female character and then have another clothed female character join?


avatar image Pseudocorpus Jul 29 '15 at 08:11 PM

Hey Tim,

thanks again for answering.

It is unlikely that the gender has something to do with the problem. The spawning character is always the same at first. Then it loads the appearance from the database (including gender, stats, clothing) and attaches the items to the pawn. But I tried two male characters with the same result.

I am trying to get it to work with blueprints now.

avatar image Tim C ♦♦ STAFF Jul 30 '15 at 02:30 PM

The reason I asked about changing the order in which characters join is because I am curious to find out if the character that is joining from the client (which is already clothed) is somehow trying to tell the server that it is wearing the same instances of clothing that the server's character is wearing.

The callstack that I received did not contain any code from your project, so I am leaning towards this being something we are not properly handling in the source code, but I still need to narrow down further what is actually triggering the crash.


avatar image Pseudocorpus Aug 01 '15 at 12:15 PM

I tried it with two women... same result. I'm not sure if it could be the same pickup-instance. The character who is already on the server uses the pickup-actors which are already on the server. The character who joins later obtains a string from the database, which describes the path/folder, where the pickup-actor lies and spawns a new actor based on that string.

If one of this actors is a clothing items, the static mesh is set to invisible and the actor is attached to the characters root. This actor also has a skeletal mesh reference, which is the rigged clothing item. The character's corresponding body part is being swapped with this skeletal mesh.

Maybe it is because I am attaching the items with the help of multicast, server and client functions and it interferes with the native attachment replication. Cause the engine seems to somehow try to detach the actors automatically from their parent-actors before attaching it to the next one.

avatar image Pseudocorpus Aug 03 '15 at 06:18 PM

Nope, I can definitely rule out any of my functions (be it RPCs or not). I made a basic attachment graph to attach an item to the character and the problem still persists.

alt text

It has to be the UE4 attachment replication.

basicpickup.jpg (58.0 kB)
avatar image Paul Ripley Jun 29 '18 at 09:17 AM

Hi all, Did this ever get officially fixed? I'm having this problem in 4.19 with exactly the same callstack mentioned above.

It sporadically happens when attaching an actor to another in a multiplayer game - sometimes the clients fail the check in the attach code when the attachment is replicated.

There is another bug that has the same callstack, but a different description here :


It is marked as Resolved, Won't Fix, and Backlogged simultaneously.

avatar image Elitic Jul 19 '18 at 10:59 AM

I'm getting same error. UE4.19.2

 LogOutputDevice: Error: Ensure condition failed: !bRegistered || GetAttachParent()->GetAttachChildren().Contains(this) [File:D:\Build\++UE4+Release-4.19+Compile\Sync\Engine\Source\Runtime\Engine\Private\Components\SceneComponent.cpp] [Line: 2009]
 LogOutputDevice: Error: Attempt to detach SceneComponent 'StaticMesh' owned by 'Wheel01_BP_C_9' from AttachParent 'StaticMesh' while not attached.

I guess we need to find workaround as they are not going to fix...

avatar image Paul Ripley Jul 19 '18 at 02:57 PM

It turned out my problem was a network race condition. I was letting UE4 replicate the attachment/detachment of actors, but also manually attaching/unattaching the same actors in response to replication notifies. Sometimes the rep notifies would get in first, and when UE4's internal replication happened, things weren't in the expected state. Just removing my manual attachment/detachment on remote clients fixed it for me.

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

2 answers: sort voted first

I have some good news and some bad news.

The bad news is that I have not yet been able to pinpoint what the cause of this issue is. The good news is that I just realized that the callstack that I was getting with your project matches the callstack of a few reported crashes that some of our developers have been trying to fix.

They had not yet been able to reproduce the crash, so I updated the ticket (UE-19264) with the steps I used to reproduce the crash in your project. This crash is currently something of a priority, so the information to reproduce the crash should help them identify what is happening.


more ▼

answered Aug 03 '15 at 06:50 PM

avatar image Pseudocorpus Aug 03 '15 at 07:23 PM

Thanks Tim! These are indeed good news. So I'll be patient and do something else in the meantime. ;)

avatar image zeroexception STAFF Aug 05 '15 at 11:25 PM

I also have good news and bad news:

Good: I've identified the crash and have a fix for it. Bad: Fix is fairly large so might not make it to 4.9 due to risk.

Technically this is not as much a crash as an assert that is not really that correct in networked games, so I will likely make it a non-fatal assert instead for 4.9 until the real fix can go in.

avatar image Pseudocorpus Aug 06 '15 at 03:33 PM

The bad news is not really bad. It is great to hear that you have found the reason for the crash. And as long as you fix it sooner or later, I am very happy. :) Though I hope the fix will make it to 4.10 / 5.0 (?)... Thanks very much, Zak!

avatar image Pseudocorpus Sep 02 '15 at 01:02 PM

I don't know if there has been a fix or not. Just want to let you know that the error still occurs in 4.9.

avatar image BenniKane Sep 03 '15 at 10:42 PM

I can confirm this. I'm running in the exact same problem trying to attach a weapon to my character.

avatar image Kris Sep 09 '15 at 05:06 AM

Hitting same wall.

I replaced the ensureMsg with a log, but that led a bad child index in USceneComponent::OnComponentDestroyed().

Through in a check for that to prevent it.

Now, when I detach the affected component it detaches several other components that were spawned client side.

Server side, the affect component does not share the same owner or parent component as those that will be spawned client side.

Client side, the bug causes the affected component to have the same parent as those spawned client side when it detaches (apparently).

Very confusing :(

avatar image zeroexception STAFF Sep 21 '15 at 06:04 PM

I'm looking in to this, I think the change we made incorrectly forces the attachment on clients to match that on the server, which effectively broke client-side-only attachment.

avatar image Pseudocorpus Sep 23 '15 at 07:01 PM

Hey Zak. Thanks for the response and your efforts. FYI: The crash now only seems to happen in the editor. The standalone-version of my game seems to work just fine.

avatar image Doug E ♦♦ STAFF Oct 16 '15 at 03:51 PM

Hey Briandrain85-

I tested the project that you had sent to Tim Lincoln and it seems that when the client joins they initially spawn as a male character and then automatically get swapped to a female character. From my tests the crash occurs when the client spawns as a male character prior to swapping to the female. I believe it may have to do with the server / client reading the same character information, however the server is flagged as "dressed" (after putting on the shirt and pants) where the client spawns as "not dressed". To help me confirm this could you point out which code files are responsible for spawning the characters after joining the server as well as which code files are responsible for swapping from the male to female when the client spawns?

avatar image Pseudocorpus Oct 17 '15 at 05:03 PM

Hey Doug! Thanks for your answer.

When the player gets spawned, ASomGameMode::InitNewPlayer fires and causes to set the ID set in the Event SomPlayerController::InitPlayer_Implementation, based on the parameters received while connecting to the server. The same Event Triggers a chain of functions inside the Som_PC - Blueprint:

  • ASomNetworking::CheckSession

  • ASomNetworking::CheckSession_Complete

  • ASomNetworking::CheckSession_Proceed_Implementation

  • ASomNetworking::LoadAppearance

  • ASomNetworking::LoadAppearance_Complete

LoadAppearance_Complete in turn calls the function ASomCharacter::SetAppearance, which sets (among other things) the gender of the character.

I hope that helps. Thanks again for your efforts.

avatar image Tim C ♦♦ STAFF Nov 02 '15 at 10:09 PM

Hi Braindrain85,

With some of the changes that have been put into the Engine, we believe we have fully resolved this issue. Could you please let us know if you see it happen again in 4.10?


avatar image Pseudocorpus Nov 05 '15 at 03:26 PM

Hey Tim,

that is very good to hear. As soon as I am getting rid of my compiler/linker-error, I will try it out. ( https://answers.unrealengine.com/questions/328721/vs2015-compiling-ue410-preview-linker-error.html )

avatar image Pseudocorpus Nov 12 '15 at 01:50 AM

I'm sorry to inform you that when I play inside the editor, my project still triggers the usual breakpoint (SceneComponent.cpp , Line 1393)

avatar image Tim C ♦♦ STAFF Nov 12 '15 at 10:56 PM

This was in 4.10, correct? We'll dig into this some more.


avatar image Pseudocorpus Nov 13 '15 at 02:05 AM

Exactly, this still happens in 4.10 (no preview-version), but only in the editor (not in the packaged version). Thank you.

avatar image Tim C ♦♦ STAFF Nov 23 '15 at 08:19 PM

Hi Braindrain85,

The sample project that you had provided for another post is now a couple versions of the Engine old. Would it be possible to get an updated 4.10 sample project to test on? If you need to provide it privately, you can reach me on the forums.


avatar image Pseudocorpus Nov 24 '15 at 06:19 PM

Hey Tim, I did send a PM.

avatar image Tim C ♦♦ STAFF Nov 27 '15 at 02:52 PM

Thanks. I got the message. We'll take another look to try to find out if we overlooked something.


avatar image RyroNZ Dec 21 '15 at 07:38 PM

Hi Tim, I am experiencing this same issue when I attempt to Attach an Actor at the start of the game with a Client. This is on 4.10.alt text

untitled.png (53.9 kB)
avatar image Tim C ♦♦ STAFF Dec 24 '15 at 09:47 PM

Hi RyroNZ,

Would it be possible to take a look at your project? We can cross-reference what is happening with your project with what is happening in Braindrain's and see if that helps to pinpoint where things are going wrong. If you would like to provide your project privately, you can send me a PM on the forums.


avatar image Tim C ♦♦ STAFF Jan 05 '16 at 11:16 PM

Hi Braindrain85,

I did some more experimenting today with the sample project that you provided, and was unable to see the crash that we originally saw there. Would you be able to provide some updated steps that trigger the crash (either here or via forum PM).

RyroNZ, we have not heard back from you for a while. Would you be able to provide a sample project demonstrating the issue you are seeing so we can compare what is happening there directly with what is happening with the other sample project we have?


avatar image nkey Jan 05 '16 at 11:50 PM

I could provide project with 100% (I hope) way to reproduce issue. I'll uploading sources somewhere, will send you in PM.

UPDATE: done, check your PM on forum.

UPDATE2: It seems to get crash I need to detach on object first.

avatar image Pseudocorpus Jan 06 '16 at 02:18 PM

Hey Tim,

I have send you a PM with the current code and description. I am testing with 4.10

avatar image uced Jan 17 '16 at 06:37 AM

Hey everyone,

I'm getting the same problem.

Tim, here is a simple say to reproduce the problem using the sample project (miniYag) i sent you for the network issue about file sharing between server and clients.

In the YagPlayerController.cpp, add the following lines around line 1430 (in the ServerSpawnObject function):

 // TEST
 if (MyGameState && MyGameState->ObjectArray.Num() > 1)
     //SpawnedObject->AttachRootComponentTo(MyGameState->ObjectArray[FMath::Min(0, MyGameState->ObjectArray.Num() - 2)]->GetRootComponent());
     SpawnedObject->AttachRootComponentToActor(MyGameState->ObjectArray[FMath::Min(0, MyGameState->ObjectArray.Num() - 2)]);

They attach each newly spawned object to its predecessor in the object array maintained by the game state.

You then just have to add two objects to reproduce the problem.

When playing with only a server the attachment works well, but when using 2 players, you'll get the crash.

Here is a video showing you everything:


I hope this helps.



avatar image Tim C ♦♦ STAFF Jan 25 '16 at 07:38 PM

Hello everyone,

Thank you for the additional test cases and patience while we work on this issue. I just ran some tests using the sample projects that were provided in 4.11 Preview 3, and in most cases the Ensure was no longer getting triggered (one sample project got stuck when trying to open, though I don't believe that is related to this particular issue). Would you be able to try your sample projects in Preview 3 and let us know if you happen to still see the Ensure?

Braindrain, in your project in particular, a different (but similar) Ensure was triggered when ending PIE. This other Ensure we believe was corrected this past weekend.


avatar image uced Jan 28 '16 at 07:32 PM

Hey Tim,

Sorry for the delayed answer, i'm using the substance plugin which has still not been released for 4.11 preview so i had to debug the 4.10 version of the plugin for it to compile on 4.11.

So i ran some tests in 4.11 preview 4 and unfortunately the bug is still present for me.

I made a quick video to show you what i do:


Of course, please let me know if you need any more info.



avatar image Pseudocorpus Jan 28 '16 at 09:01 PM

I tested Preview 4 and it all seems to work really well. This is going to be a great Update. Hope it stays that way, but I will re-open this thread if the error occurs again. Thank you so much. You are great. :)

avatar image uced Jan 30 '16 at 11:05 AM

Hey Tim,

I tried on a packaged game and it worked, even in 4.10.

So in short, on my side:

  • it works well on packaged game even in 4.10

  • It doesn't work in PIE even in 4.11



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

Hello everyone,

Thank you for the additional test projects that were provided. I have created a new ticket to continue investigating this issue (UE-25221). With the additional information that was provided, I am hopeful that we will be able to pinpoint what is going wrong.


more ▼

answered Jan 11 '16 at 08:33 PM

avatar image matkins Jul 04 '16 at 09:30 AM

Hi there,

What is the status of this ticket?
We are having an issue caused by the change in UE-19264:

The issue is that, on the client, the parent's replicated AttachChildren is first being updated via property replication and this is conflicting with the subsequent Detach/DetachFromParent code that expects to be the one that modifies AttachChildren.


avatar image Tim C ♦♦ STAFF Aug 29 '16 at 08:39 PM


Sorry for the delayed response. I checked the post that you linked, and it looks like someone else had already responded there. For the sake of everyone on this thread, the issue that you described is a known issue that was reported in UE-26025. Unfortunately we do not have a solution for this issue at this time.


(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