Description

We should modify FindBestMatchingFunc_Internal for the case of UObject pins to search for a best matching subclass instead of just use the base UObject comparison. 

 

We could also exclude any function defined outside of an Engine module too, that way any custom added operators are not added to type promotion. 

Steps to Reproduce
  1. Make a custom subclass of UObject
  2. Add this static function to a BP function lib: 
  3.   UFUNCTION(BlueprintPure, meta = (DisplayName = "Equal Custom Object", CompactNodeTitle = "==", Keywords = "== equal"),Category = "Test")    static bool EqualEqual_LobbyIdLobbyId(UCustomObject* A, UCustomObject* B) { return A == B; }

     

  1. Open a blueprint and create a variable of type UCustomObject
  2. Add the == comparison function to the graph

Result: it uses the default UObject equals comparison, not the subclasses

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-156031 in the post.

1
Login to Vote

Backlogged
ComponentUE - Gameplay - Blueprint Editor
Affects Versions5.0
CreatedJun 7, 2022
UpdatedMar 17, 2023