Enabling Physics On Subcomponent Detaches Component

While I do understand why this behavior is “By Design” (as noted in Unreal Engine Issues and Bug Tracker (UE-19584)), and your explanation made it click for me, I would highly recommend some code documentation to be added along the lines of
“If bSimulate is true, also detaches the component from its parent.”.

This “bug” (I would still classify it as documentation bug, after all, it’s a function that does stuff you would never expect it to by reading the name or documentation) bit me during a game jam and I wasted roughly 10 hours trying to figure out what the hell was going on until my mental model was set straight.

Such a line could help other people similarly inexperienced with UE4 not to waste time figuring this out on their own or randomly stumbling upon this thread during google searches.

Another maybe neater option would be adding “bool bDetach” to the parameters of setSimulatePhysics (obvisously default true for bw compatibility), which would give an immediate hint that detaching is going to happen. I’d be very happy to see someone doing this probably easy change. Please do let me know if you do :slight_smile:

1 Like