Blueprint reference bug [Demo included]

I’ve noticed this bug when in my game, only after packaging, my player character disappeared with all his controls/camera/etc. I was investigating it for a whole day and finally i’ve managed to spot this bug and recreated it in new, simple project with a few BP classes: BUG DEMO PROJECT

Instructions:

After opening the project, look into Output Log. There are 2 warnings:

LogBlueprint:Warning: [compiler TESTClass] Warning Can’t connect pins Target and As My Player : Unit Reference is not compatible with My Player Reference.

LogBlueprint:Warning: [compiler TESTClass] Warning Can’t connect pins As My Player and Target : My Player Reference is not compatible with Unit Reference.

(… Which are obviously compatible, because MyPlayer is a child of Unit class. Besides, it works fine, though these warnings, which show only after opening the project)

Now, delete “varOfTESTClassType” variable in “MyController” class.
Close the project, open it again, and the warnings are gone. If you add this variable again, they will appear again after re-opening the project.

It seems like it’s a problem with the way Blueprints are referencing each other. In this demo project it does not have any effect besides these warnings, but when you build more on top of this, it will cause really bad project-breaking things like player character disappearing after packaging.

Hi ,

I haven’t been able to reproduce this quite yet on my end. Can you walk me through what specific steps you take to reproduce this with your demo project?

In my case, I just need to open my project, that’s all - and then, this is what my Output Log says:

As for now, it does not break any things in game, these are just warnings, but i have a lot of them in my main, more advanced project. They show in Output Log only after opening a project.

  • As i said in the first post, “Now, delete “varOfTESTClassType” variable in “MyController” class. Close the project, open it again, and the warnings are gone. If you add this variable again, they will appear again after re-opening the project.”

If these warnings do not display on your end, maybe there is some problem with my machine (maybe some Visual bad setup or something? I don’t know…) - maybe I should just ignore these warnings?

I’m not certain. I didn’t see these errors in PIE or in a packaged project, however it is typically not advised to ignore warnings. Are you using 4.8 or 4.8.1 when you see these errors?

I’m using 4.8.1, but it was the same on 4.8.
Yes, these warnings appear ONLY just after opening the project, and never again. And they don’t pop up automatically, so you must manually open Output Log window to see them.

Ah, I see it now. I think this is because that value is a NULL value. You haven’t populated it with anything quite yet. What is the end goal you are looking to achieve?

TESTClass gets player character and displays it’s name on Begin Play. It’s just for demonstration purposes, to show that this type of blueprint reference setup (maybe circular reference?) causes these warnings. After removing variables/references listed in my first post, these warnings disappear.

I think it might be because just after opening the project, all the blueprints are not compiled 100% yet (so maybe they have NULL values), but it checks it already and says things like “Unit is not compatible with MyPlayer”, when it obviously is, because MyPlayer class derives from Unit class.
I lean toward ignoring these warnings, because there are more of them even in default, fresh project (like these “Failed to find object ‘Class None.’”, etc.)

Have you tried compiling and saving all of your blueprints and then saving, closing, re-opening the editor?

I’ve just did this and nothing changed, the warnings are still there. Maybe they’re ‘fake’ warnings (inaccurate ones)? Because there are few more warnings showing up at startup in Outpu Log even on every new, clear project (like “LogUObjectGlobals:Warning: Failed to find object ‘Class None.’” or “LogDirectoryWatcher:Warning: Failed to begin reading directory changes for …/…/…/Engine/Plugins/Experimental/CharacterAI/Content/. Error: 0”, etc.)

It is very possible. For now I would keep an eye on them, if they start to affect work or gameplay then we can look at this again, but for now I can’t see anything they are actually affecting nor any reason/reproduction on my end to get them to show up in a new project. I’m going to mark this as answered for tracking purposes, however if they do start to affect things other than your output log let me know and I’ll take another look.

(I’ll use the class names of the OP… mine are obviously different, but I am experiencing the same bug) I debugged the code and found that, at certain times, it happens that class MyPlayer does not appear to derive from a class named “Unit” but from a class named “REINST_Unit”. The engine is just complaining that the two classes are unrelated, while, of course, they aren’t. Hope it helps.

The REINST usually occurs when you’ve moved an asset to a different location and have not fixed up redirectors. What steps are you taking just before this error occurs?

The warning messages appear in the log each time I open the editor and when packaging. We are a large team, so I can’t be sure what steps could reproduce our situation, but I personally ran a project-wide redirector fix-up recently. I will investigate further in this direction though.

Correction: the messages appear only each time I launch the editor, not when packaging. I can confirm that all redirectors in the whole project are properly fixed up.

Yes, it was the same in my case, these warnings show only after opening a project. My redirectors are also ok.

Hi iaanus,

Do these errors seem to cause any functionality problems or, like , do they not seem to actually interfere with your blueprints/code?

They do not seem to interfere in significant ways.