AActor::DetachRootComponentFromParent
Deprecated: Use DetachFromActor() instead.
#include "GameFramework/Actor.h"
Access: public
Specifiers: UFUNCTIONBlueprintCallableUE_DEPRECATED
Description
Deprecated function that detaches this actor's root component from its parent. Replaced by DetachFromActor() / K2_DetachFromActor() since UE 4.17.
Caveats & Gotchas
- • Deprecated since UE 4.17. Use DetachFromActor() with FDetachmentTransformRules instead, which gives separate control over Location, Rotation, and Scale detachment rules.
- • The bMaintainWorldPosition parameter maps to EDetachmentRule::KeepWorld; the modern API makes this more explicit and less error-prone when dealing with scaled parents.
Signature
ENGINE_API void DetachRootComponentFromParent(bool bMaintainWorldPosition = true); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| bMaintainWorldPosition | bool | If true, compensates the transform so the actor stays in the same world-space position after detaching. | true |
Return Type
void Example
Preferred modern equivalent C++
// Old (deprecated):
// MyActor->DetachRootComponentFromParent(true);
// Use this instead:
MyActor->DetachFromActor(FDetachmentTransformRules::KeepWorldTransform); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | deprecated | Deprecated since 4.17; retained for Blueprint compatibility only. |
Feedback
Was this helpful?