MYPROJ.generated.cpp(160): error C2678: binary ‘=’: no operator found which takes a left-hand operand of type ‘const TAssetPtr’ (or there is no acceptable conversion)
Cause generated code tries to write into the parameter.
Pass-by-ref compiles but only let’s the parameter to be used like a out parameter, not an input parameter:
Reflection system need to define the function and implement code in to it in order for events work in blueprints when you call function in C++. Insted you need to override with “_Implementation” surrfix in name and i think you need to do BlueprintNativeEvent in order to do so as calling native events from blueprint requires some extra code in reflection system. In base class (with BlueprintNativeEvent) it’s already declered so you need just to define it in cpp file, in child class you need to declere override.
In case of const refrence to fail theres also UPARAM(ref) which inform reflection system that this is suppose to be input refrence pin
Currently Blueprints do not support passing a TAssetPtr by value in this way. The TAssetPtr would need to be passed by reference, either as a const reference or by using the UPARAM macro mentioned by . However, there does seem to be a bug present for passing a TAssetPtr as a const reference that is manifested in the generated code. I have submitted a report to have this investigated further (UE-24034).