Reusing legacy TRASHED_xxx variable names

I ran into this issue today. I think I found the fix.

The problem is that I used a C++ class which has a blueprint which inherits from it. Within the C++ class, several weeks ago I had created a set of scene capture components with the names, “Cam1, Cam2, Cam3, Cam4”. Later on, I deleted these variables and forgot about it.

Today, I created new scene capture components and I used “Cam0, Cam1, Cam2, Cam3” as variable names. Only “Cam0” worked, the other variables got turned into null references. I think what’s happening is that just because I remove or rename a variable in C++, it does not mean that it is actually removed from the blueprint. The variable just gets a TRASHED_xxx prefix. So, if you reuse an old variable name in C++, even if its new, it collides with the old variable name and the engine trashes it.

My work around is to rename my variable to “CamA, CamB, CamC, CamD” and this works with no problems.

I haven’t tried it yet, but creating a new blueprint from scratch should also resolve the issue.

Hello,

We’ve recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

https://epicsupport.force.com/unrealengine/s/

Thanks