Description

If a Blueprint asset contains a function call node for which the referenced function context is set to 'self', if the "Target" pin is connected to a type that equates to the owning Blueprint asset (other than a reference to self - e.g. a variable of the same type), then duplicating the Blueprint will result in a compiler error in the duplicated asset.

When duplicated, the function node's reference context will now reference the duplicated Blueprint class (as that is the new 'self'), but the connected pin will remain set to the original Blueprint type, so the two sides are no longer type-compatible and will fail validation at compile time. This is the source of the error that occurs.

Workaround: Drag off the variable pin in the duplicated Blueprint asset and re-select the function. This will create a new function call node with a calling context set to the source Blueprint's class, and that Target pin can then be connected to the variable's output pin. Then delete the original function call node that it was previously connected to.

Steps to Reproduce
  1. Launch UE5 editor (e.g. QAGame).
  2. Create a new Actor-based Blueprint asset and open it for editing.
  3. Add a new function (TestFunction). Arguments are optional.
  4. Add a new variable of the current Blueprint type (NewBlueprint).
  5. Drag the new variable into the event graph and drop a "get" node.
  6. Drag off the "get" node and choose the "TestFunction" call.
  7. Wire the "TestFunction" call to the "BeginPlay" event.
  8. Compile, save and close the Blueprint
  9. Right-click on the Blueprint asset in the Content Browser and choose "Duplicate."
  10. Double-click the duplicated asset to open it for editing.
  11. Note that there is a compiler error.
    Expected result: No compiler errors in the duplicated asset.
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-177975 in the post.

1
Login to Vote

Backlogged
ComponentUE - Gameplay - Blueprint Editor
Affects Versions4.275.05.1
CreatedFeb 21, 2023
UpdatedFeb 13, 2024