FSoftObjectPath::FixupForPIE
#include "UObject/SoftObjectPath.h"
Access: public
Description
Remaps the path's package name to the PIE-prefixed duplicate so that soft references resolve to the correct PIE world copy rather than the editor asset.
Caveats & Gotchas
- • There is a second overload — FixupForPIE(int32 PIEInstance, ...) — that takes an explicit PIE instance index. The single-argument version queries GPlayInEditorID internally; prefer the explicit-index overload when you have the instance number available to avoid stale global state reads.
- • Returns false (and does not modify the path) if the path does not need PIE fixup — e.g. it already points to a PIE package, or it references an asset that is not duplicated for PIE. Always check the return value when logging fixup results.
Signature
COREUOBJECT_API bool FixupForPIE(TFunctionRef<void(int32, FSoftObjectPath&)> InPreFixupForPIECustomFunction = FSoftObjectPath_DefaultPreFixupForPIEFunction) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InPreFixupForPIECustomFunction | TFunctionRef<void(int32, FSoftObjectPath&)> | Optional pre-fixup callback invoked before the standard PIE package rename, allowing custom remapping logic. | FSoftObjectPath_DefaultPreFixupForPIEFunction |
Return Type
bool Example
Fixup a soft path when duplicating for PIE C++
// Inside a custom actor duplication step for PIE
FSoftObjectPath SoftRef = GetMySoftRef();
if (SoftRef.FixupForPIE())
{
UE_LOG(LogTemp, Log, TEXT("PIE remapped to: %s"), *SoftRef.ToString());
} See Also
Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?