Description

As with most nodes, object reference outputs can be directly connected to interface-typed inputs on "make container" nodes (e.g. "MakeArray") if the object's class type implements the interface class.

However, there is currently no cast logic in place to convert the object term to an interface term, so the input remains an object reference term at runtime. This means the VM will only store the object's address into the first field of the FScriptInterface type for each input value, so the interface address field of each element is left as NULL as a result. This is demonstrated by the "invalid" case in the attached project.

By contrast, the "valid" case in the attached project works because Array_Add is a function call rather than a custom node type, and function call nodes already add an implicit cast from object to interface at compile time (see FKCHandler_CallFunction::RegisterNets).

In lieu of a fix, the workaround is to explicitly add a "Cast to <interface type name here>" node in between the object reference output and the "make container" node's input pin (see attached image).

Note: this issue will also be exhibited by "MakeSet" and "MakeMap" container nodes. These are not covered in the attached project, but test cases can be set up similarly.

Steps to Reproduce
  1. Open the attached project (choose to convert to current version if prompted).
  2. Start PIE, and note the following warning appears in the output log:
    LogClass: Warning: Invalid InterfacePointer - Object Name (MyObject_1)
    

    Expected result: No warnings appear in the output log.

Callstack

N/A

Have Comments or More Details?

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

0
Login to Vote

Unresolved
ComponentUE - Gameplay - Blueprint
Affects Versions4.275.05.1
Target Fix5.5
CreatedJan 28, 2023
UpdatedFeb 13, 2024