Cannot get rid of Variable from Widget Blueprint...

Anyway this is sort of weird. So, let me explain what I did to make it happen.

I had a uniform grid in the widget design and had it referenced in the graph / macros / functions. It was called: UGrid as the variable name. Nothing weird about that.

Then, I used the Replace With option on it and replaced it with a Wrap Box. Then hit save and compile… This is where things get weird now. Compile couldn’t complete, because things were still trying to access UGrid.

Somehow, during that it created a new variable called: UniformGridPanel_0. Just one problem, there is no grid in the designer anymore, and it won’t let me remove the variable. I have corrected the references, saved, and recompiled just fine. But, I cannot get rid of the: UniformGridPanel_0 variable now…

Another weird thing is that during the compile error, it repeated Image_119 over and over again in the Variable list. Image_119 is a real variable, but I only had one.

Below is the image of the variable I cannot remove.

Here is the design item list

I’ve seen a similar thing happen with umg animations. You can be stuck with a rogue one in the list that does not belong to any element, it is greyed out and cannot be deleted.

Have you tried manually reloading the asset in the Content Browser? Right click the widget → Asset Actions → Reload. It’s unlikely to help but it’s worth trying before you decide to redo the entire widget from scratch.

If you right click the Blueprint in the content explorer, and choose “Duplicate”, the duplicate won’t have that variable, alternatively, you can close and reopen the editor to remove it.

UE4 clearly knows it doesn’t belong there, it’s just an error with the replace function, when the object being replaced is a variable, so reloading it as per Everynone’s suggestion probably works too.

To delete Animation variables, the solution is not to duplicate/ reproduce the entire BP.

It’s this: Switch to Designer mode and open up Window > Animation. You want to get to the Animation timeline tab.

Here, you will see the Animation variables which you can then delete.

Hope this helps!

2 Likes