Blueprint won't open because I doubled a for loop? Can I recover it? the code?

I have/had a huge main blueprint with 80% of my code. In it I added 2 for loops to make a grid of static meshes, but I accidently looped the end of the second for loop back to the first somehow.

Then I accidently saved compiled, then unreal crashed.

This is the last thing I remember.

Now I can’t open this blueprint, Unreal just freezes when I try.

Is there any way to recover the blueprint from this or do I need to start again?

Is that done in costruction script? :smiley:

I hope you did backup (even local copy) right after it happened.

Because unreal keeps recent backups/autosaves in autosave folder. You just need to find which one file there is backup/autosave of your most recent blueprint before first crash.

However if you keep trying to load/run it, unreal at some point will replace last working autosave.

So make local copy of that project. Look for files that have similar size (in BYTES) to crashing blueprint. Then look inside crashing blueprint and file from autosave and compare if they have same names there (like function or variable names you used in blueprint). then pick autosave file that has closoest date to time before first crash.

And for the futur: github gitlab, have FREE accounts, and plenty of tutorials how to setup your own projec there. So use it, crate githug store project there. You can even store your project locally (you do not need to push changes, just commit and it will keep backup, so you can always restore it locally).

1 Like

The blueprint still had all my original code, the for loop was added but I didn’t delete of the code! so the old code should still technically be in this file…

My plan is to somehow open the blueprint file in a text editor or IDE or something and then remove the double for loop or the link that broke it then save it and open it in unreal.

Can this be done?

No it cannot be done (unless you exported it as a text, however not sure if this still works in ue5), by default blueprints are kept as binary files. Your only chance is restoring it from autosaves, and more you mess with project (without backup) higher chance for unreal to overwrite last working autosave.