Local variable in collapsed graph not updated if function renamed (compile error)

If you have a local variable being used inside a collapsed graph inside a function, and you rename the function, it fails to compile until you place a new get/set of the variable in the collapsed graph.

To reproduce in blank 4.16:

  1. Make a new actor, and inside it a function called :Function1:
  2. Add a local variable, Set it to anything, then place a Get node and hook it up as a ReturnValue.
  3. Collapse the Get node into a collapsed graph node. Note that it compiles fine.
  4. Rename the function e.g. “Function2”, try to compile. It will say that it’s unable to find the Get variable.
  5. Place a new version of the Get variable and use that instead, note it will compile OK now.
1 Like

Hi Spoondog,

Thank you for the report. I was able to reproduce this in 4.16 but this is now working correctly in our latest internal build. You will see this fixed in a future engine version.

To fix this without adding a new version of the variable, you can go into the collapsed graph > Right-click on the local variable > Choose Replace Variable.

139935-collapse1.png

-TJ

1 Like

fwiw, in 4.27, it doesn’t look like this problem was ever fixed. Also taking a pile of nodes inside a function that refer to local variables, and using the Collapse option on them results in the exact same thing, and you have to go through each of the references and replace them and refresh the nodes.

1 Like