Issue with FComponentReferenceCustomization and FSoftComponentReference

It seems like the issue is that the code in FComponentReferenceCustomization::SetValue and FComponentReferenceCustomization::GetValue is incorrectly gating the assignment of the

ComponentProperty and

PathToComponent members based on OtherActor.IsValid() however OtherActor will be null if the component is one the same actor.

Changing the code to do something like this seems to resolve the issue:

// SetValue
FSoftComponentReference SoftValue;
if (Value.OtherActor.IsValid())
{
  SoftValue.OtherActor = Value.OtherActor.Get();
}
SoftValue.ComponentProperty = Value.ComponentProperty;
SoftValue.PathToComponent  = Value.PathToComponent;
 
// GetValue
FSoftComponentReference SoftReference = *reinterpret_cast<const FSoftComponentReference*>(RawPtr);
if (SoftReference.OtherActor.IsValid())
{
  ThisReference.OtherActor = SoftReference.OtherActor.Get();
}
ThisReference.ComponentProperty = SoftReference.ComponentProperty;
ThisReference.PathToComponent  = SoftReference.PathToComponent;

Btw the recent changes in UE5 Main (CL 51539355 and CL 50903512) are very helpful, thank you! we have cherrypicked those.

EDIT: Also we just noticed FSoftComponentReference::SerializeFromMismatchedTag has a similar issue

[Attachment Removed]

Steps to Reproduce

  1. Add a UPROPERTY of type FSoftComponentReference to an Actor class, with meta = (UseComponentPicker)
  2. Place an instance in a level and select it.
  3. In the Details panel, open the component picker and choose a component on the same actor
  4. Observe that the picker closes but the property remains at its previous/empty value.

[Attachment Removed]

Hello,

Thanks for reporting this issue!

I wrote a fix for the wrong usages of FSoftComponentReference, currently in review.

I’ll let you know when it will be available.

Yohann

[Attachment Removed]