Even though it is possible to replicate TWeakObjectPtr successfully and safely, the following does not compile as the RepNotify function will not allow me to it for an ‘Old’ value parameter.
UFUNCTION() void OnRep_Source(const TWeakObjectPtr<UObject> OldSource); UPROPERTY(Transient, ReplicatedUsing = "OnRep_Source") TWeakObjectPtr<UObject> Source;
Prints the following output message:
error C2275: 'TWeakObjectPtr<UObject,FWeakObjectPtr>': illegal use of this type as an expression note: see declaration of 'TWeakObjectPtr<UObject,FWeakObjectPtr>' error C2065: 'Z_Param_OldSource': undeclared identifier error C3861: 'P_GET_WEAKOBJECT': identifier not found
Bug Report Submitted (Case# 00058608)
Passing by non-const, or const-ref still causes same issue.