[4.11] DetachRootComponentFromParent causes self-collisions

Hi guys,

We’ve got a handful of complex actors built with he auto-weld option. Various physical components with collisions are welded together as a single actor, and all is fine.

But if we attach that actor to another through AttachRootComponentToActor, and then call DetachRootComponentFromParent, the detached actor starts getting self-collision events. All of his internal components start colliding with each other - the NotifyHit function gets called over and over, physics break down, etc.

When debugging, it appears that in the end-frame physics step (TG_EndPhysics), we get one collision event for each component in the actor, all of them colliding with our root object.

We’re not having the issue on 4.10, or 4.11 P6, it’s a regression from Preview 7.

Hello Gwenn,

Due to the set up for this issue, would it be possible for you to provide a small sample project or some steps for setting up a reproduction case? I actually ran into an unrelated crash while trying to set up something to reproduce this so it would be helpful if you could do so. If you don’t have the time, let me know and I’ll continue to work on it.

We went back to Preview 6 because of this issue and the one described here : [4.11] PhysX component-related crash - Programming & Scripting - Unreal Engine Forums so I’d rather stay there - Preview 7 prove too unstable.

If you can’t reproduce the issue I’ll provide you with a minimal project, but I believe this issue is easy to reproduce.

It would be helpful if you could provide a reproduction project, even if it is in Preview 6 as I should be able to convert it to Preview 7. I’m currently being blocked by that crash I found which is preventing me from doing some very basic C++ things with custom classes, which I’ve reported. It’s possible that this issue didn’t occur for you since, I imagine, the project was converted from a previous version of the engine.

Hello Gwenn,

I’ve tried reproducing this without much luck, after working around the crash I was running into. This could have something to do with your particular code/blueprint set up. Could you go into more detail about the multiple components/collisions you’re using and what type of actors these actors are? I tried something simple using a base C++ class based off Actor with a Skeletal Mesh and a Static Mesh with auto-weld then having them attach/detach to another actor using the functions you specified without any odd results when it comes to collision events.

Well we’re still seeing the issue on Preview 8 and Preview 6, but not as regularly as on Preview 7, so it may come from our side.

Simply put, each Pawn in our scene is made of ~30 components derived from UStaticMeshComponent, using autoweld. Everything is set to simulate physics, collision to block all dynamic, and we haven’t had issues for almost two years - this project is almost as old as the public UE4.

Every time the issue reproduces, it happens during the same frame we call DetachRootComponentFromParent, then during the physics steps we have as much collision even (on the detached pawn) as we have components.

Thank you for the information. To clarify, when you mention that “this project is almost as old as the public UE4” do you mean that this has been the exact same project the entire time, just converted from version to version? If so, would it be possible to try migrating the content / source to a new project to see if the conversions could be causing the issue?

In the meantime, I’ll continue trying to reproduce the problem with the set up you specified.

Hello Gwenn, have you had a chance to try migrating the content to a new project? Unfortunately I’ve had no luck reproducing the issue on my end.

Thanks for looking into this !

I’m afraid we’re having the issue in a very sporadic manner - like every 10 minutes of gameplay. The only thing I’m sure about is how it happens - detach the actor, get self-collisions between your components. At the very least, is this even supposed to be possible - why would components of an actor collide with each other ?

I’ll reply here if I can provide you a project that replicates the issue in a consistent way, so if you can’t reproduce it, don’t waste your time.

Understood. I’ll be waiting for your response about this issue. In the meantime, I’ll be using this as a temporary answer to leave this issue marked as resolved for tracking purposes.

Hey, we tracked down the issue on 4.12 and reported the issue here : Unwelded components collide within actor - World Creation - Unreal Engine Forums