Description

UBlueprintEditorLibrary::RemoveUnusedVariables removes (object) variables from a blueprint even if that blueprint graph had Event nodes that are bound "inline" to that object variable. For example: a primitive component's OnActorBeginOverlap can have an event bound to it by right clicking the component > Add Event. RemoveUnusedVariables will not consider that and still remove it.

Expected: an event being bound to it "inline" i.e. via "right click > Add Event" will make the variable treated as in use.

Steps to Reproduce

User's repro steps:

  1. Create a new Actor blueprint
  2. Add a variable to the new blueprint of an object type (e.g. a Static Mesh Actor object reference)
  3. Select the new variable and add an event from the Details pane (e.g. an On Actor Begin Overlap event)
  4. Compile and save the blueprint
  5. Create a new Editor Utility Blueprint (for this example, an Asset Action Utility)
  6. Add a new function to the utility blueprint that runs the "Remove Unused Variables" function on selected assets
  7. Select the previously-created Actor blueprint and run the new utility function on it
  8. Compile the Actor blueprint and note that the Static Mesh Actor variable has been removed, and its event node is now missing a valid matching component

Have Comments or More Details?

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

0
Login to Vote

Fixed
ComponentUE - Gameplay - Blueprint
Affects Versions5.2
Target Fix5.4
Fix Commit31021768
Main Commit31025854
Release Commit31021796
CreatedOct 4, 2023
ResolvedJan 30, 2024
UpdatedMar 1, 2024
View Jira Issue