UKismetSystemLibrary::DuplicateObject
#include "Kismet/KismetSystemLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintCallable
Description
Duplicates an object to a new instance, copying its property values into a fresh UObject with the given outer and name.
Caveats & Gotchas
- • Only compiled with WITH_EDITOR — this node is not available in packaged/runtime builds; it's an editor-tooling utility, not a gameplay spawn/duplicate function.
- • Returns null if the duplication fails (e.g. invalid SourceObject).
- • This is a shallow wrapper around the engine's StaticDuplicateObject — it does not spawn actors into a world or trigger BeginPlay; for runtime actor duplication use SpawnActor or similar.
Signature
static UObject* DuplicateObject(const UObject* SourceObject, UObject* Outer, const FName Name = NAME_None) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| SourceObject | const UObject* | The object being duplicated. | — |
| Outer | UObject* | The outer to use for the new instance. | — |
| Name | const FName | The optional name of the new instance. | NAME_None |
Return Type
UObject* Example
Duplicate a data asset for editing in isolation C++
#if WITH_EDITOR
UObject* Copy = UKismetSystemLibrary::DuplicateObject(SourceDataAsset, GetTransientPackage(), FName("MyDataAsset_Copy"));
#endif Tags
Version History
Introduced in: 4.24
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?