UE-74146

Soft Object Pointers may not fire Rep Notifies

Soft Object Pointers may not fire Rep Notifies

User reported that Soft Object Pointers may not fire RepNotifies properly.
This is likely also the case with Weak Object Pointers (and other similar wrappers).

The main problem is that these all get bundled as ObjectProperties, and RepLayout has custom logic which will attempt to resolve the Object before comparing pointers.

This means that for Soft Object Pointers, when a given object isn't loaded yet (due to Level Streaming, haven't been explicitly loaded, etc.), the resolved object will always be null. So, even if two Soft Object Pointers don't point to the same object, if neither object has been loaded they will both resolve to Null and won't fire a RepNotify that is not marked as "Always" fire.

Steps to Reproduce

See UDN for context.

Create a new Actor that's replicated.

Add a Soft Object Pointer property to the actor. Make the property replicated with a RepNotify.

Point the Soft Object Pointer to some asset that is not loaded as the default.

In BeginPlay, on the Authority Machine, change the Soft Object Pointer to a different asset that's not loaded.

Expected:
When the property is changed, it will be replicated and trigger the RepNotify regardless of whether or not the objects are loaded.

Actual:
When changing the value between multiple unloaded assets, the property will not replicate or trigger rep notifies.

Have Comments or More Details?

There's no existing public thread on this issue, so head over toAnswerHub just mention UE-74146 in the post.