Resolving soft reference in a object fails since 5.1

Hey all!

As you can see in the image I’m trying to resolve a soft reference in two places.
1st one is an actor in the world, that succeeds.
2nd one is an object and that one fails.
For both instances, i used the class picker to set the references.
Also, the references are exactly the same.
Still the actor succeeds and the object fails.
In our logic I’m also using the c++ equivalent: Get().
That also fails.

This is weird because we used this logic before 5.1 and then it worked fine.
Had anyone have some experience on this issue or advice for us?

With kind regards, Alex.

Hi @Vi-So_Construct, I managed to reproduce this. But your assumption is incorrect. It’s not whether or not the parent class is an Actor or an Object, the actual issue happens when the variable isn’t public (the little eye icon on it is closed).

image

If I trace out the actual value of the soft reference at runtime I get different values depending on whether or not it’s public:

/Memory/UEDPIE_0_MainGrid_L0_X0_Y2_DL0.TestOpenWorld:PersistentLevel.StaticMeshActor_UAID_E04F43E6BBBD4E5901_1334185872
/Game/TestOpenWorld.TestOpenWorld:PersistentLevel.StaticMeshActor_UAID_E04F43E6BBBD4E5901_1334185872

As you can see, one has the PIE (play in-editor) path fixed up, the other one doesn’t. There seems to be a bug in the engine where non-public soft references don’t get fixed up for PIE.

I’ll report this to the team, in the mean time to get around this error, make sure your property is public.

All the best,
-Ari-

1 Like

Hmm, actually, I just re-tested this on an empty repro project and now it fails on the Object, even if it’s marked as public! So ok, yeah there’s something definitely weird going on with Objects. I’ll update the bug ticket.

1 Like

I can’t reproduce it on the latest (unreleased) 5.2, it seems to be fixed there already :+1:

@Ari_Epic It seems to be fixed now with 5.1.1 hotfix!
Thanks for all your help, and thanks Epic for fixing it!

1 Like