RealDocs

FSoftObjectPath::SerializeFromMismatchedTag

function CoreUObject Since 4.18
#include "UObject/SoftObjectPath.h"
Access: public

Description

Handles backward-compatible loading when an on-disk property type does not match FSoftObjectPath — for example, when a property was previously a raw FString or FName asset reference and has since been converted to a soft reference.

Caveats & Gotchas

  • This is called automatically by the serialization system via TStructOpsTypeTraits `WithStructuredSerializeFromMismatchedTag`. You do not call this directly in normal game code.
  • Returning false means the mismatch could not be resolved and the property will be zeroed — a silent data loss. Check the cook and save output logs for 'SerializeFromMismatchedTag' warnings whenever changing a property's type.

Signature

COREUOBJECT_API bool SerializeFromMismatchedTag(struct FPropertyTag const& Tag, FStructuredArchive::FSlot Slot);

Parameters

Name Type Description Default
Tag struct FPropertyTag const& The property tag from the serialized data describing the on-disk type.
Slot FStructuredArchive::FSlot The archive slot to read the mismatched property value from.

Return Type

bool

Example

Type migration that triggers this automatically C++
// If you previously had:
//   UPROPERTY() FString AssetPath;
// and changed it to:
//   UPROPERTY() FSoftObjectPath AssetRef;
//
// The engine calls SerializeFromMismatchedTag automatically on load
// to convert the stored FString into an FSoftObjectPath.
// No manual code is needed — just resave assets after the type change.

Version History

Introduced in: 4.18

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.