RealDocs

USceneComponent::DetachFromComponent

function Engine Blueprint Since 4.0
#include "Components/SceneComponent.h"
Access: public Specifiers: virtualUFUNCTIONBlueprintCallable

Description

Detaches this component from its parent scene component, resolving the transform according to DetachmentRules. The component becomes a root or unparented component after this call.

Signature

virtual void DetachFromComponent(const FDetachmentTransformRules& DetachmentRules)

Parameters

Name Type Description Default
DetachmentRules const FDetachmentTransformRules& Controls how location, rotation, and scale are handled on detach (KeepRelative or KeepWorld).

Return Type

void

Caveats & Gotchas

  • Use FDetachmentTransformRules::KeepWorldTransform to maintain position in the world after detaching — the most common intent.
  • Welded simulated bodies are automatically unwelded, but some physics state changes from welding may not be fully reversed.
  • The Blueprint-callable version is K2_DetachFromComponent (exposed as 'Detach From Component').

Example

Drop a held item in place C++
ItemMesh->DetachFromComponent(FDetachmentTransformRules::KeepWorldTransform);
ItemMesh->SetSimulatePhysics(true);

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.