Derived Blueprint Compiling Errors and Inconsistent Behavior

Hello again. I’ve upgraded my project to 4.3 and while many of my child/parent blueprint woes seem to have been fixed, I’m still having some major issues. I’ve found some really strange workarounds, but they don’t fix the underlying problem and will, assuredly cause issues in the future.

Problem:
Assigning a derived object to a variable classed to the parent fails compiling when running the standalone game. When compiling and running in PIE, this does not happen.

This is the error in the log:

[2014.07.18-18.45.33:893][261]LogBlueprint:Error: [compiler] Error COMPILER ERROR: failed building connection with 'object'BP_Attack_Turbo_C' is not compatible with object'BP_Attack_C'' at  SpawnActor BP_Attack_Turbo_C 

BP_Attack_Turbo is derived from BP_Attack. Here is a screenshot of the graph:


Expected behavior:
Derived objects should be assignable to variables classed to their parent class (As it’s working in PIE)

Funky workaround:
By forcing the object returned from the spawn to its own class, the error is avoided and things seem to work:


While this allows the code to progress, I get this error in the log when running the standalone game:

[2014.07.18-18.55.59:446][ 94]LogBlueprint:Warning: [compiler] Warning Type mismatch between pins  AsBP_Attack_Turbo_C  and  CurrentAttack 
[2014.07.18-18.55.59:446][ 94]LogBlueprint:Warning: [compiler] Warning Type mismatch between pins  CurrentAttack  and  AsBP_Attack_Turbo_C 

Also, the game seems to compile the Pawn two times, each time with warnings about accessing ancestor functions:

[2014.07.18-18.55.59:446][ 94]LogBlueprint:Warning: [compiler] Warning Type mismatch between pins  AsBP_Attack_Turbo_C  and  CurrentAttack 
[2014.07.18-18.55.59:446][ 94]LogBlueprint:Warning: [compiler] Warning Type mismatch between pins  CurrentAttack  and  AsBP_Attack_Turbo_C 
[2014.07.18-18.55.59:447][ 94]LogBlueprint:Warning: [compiler] Warning Type mismatch between pins  Target  and  CurrentAttack_Sheild 
[2014.07.18-18.55.59:447][ 94]LogBlueprint:Warning: [compiler] Warning Type mismatch between pins  Target  and  CurrentAttack_Sheild 
[2014.07.18-18.55.59:447][ 94]LogBlueprint:Warning: [compiler] Warning Type mismatch between pins  CurrentAttack_Sheild  and  Target 
[2014.07.18-18.55.59:447][ 94]LogBlueprint:Warning: [compiler] Warning Type mismatch between pins  CurrentAttack_Sheild  and  Target 
[2014.07.18-18.55.59:463][ 94]LogBlueprint:Warning: [compiler] Warning [0004.78] Compile of BP_QuadCopter_MP_Pawn successful, but with 6 Warning(s) [in 32 ms]
[2014.07.18-18.55.59:796][ 94]LogBlueprint:Warning: [compiler] Warning Type mismatch between pins  AsBP_Attack_Turbo_C  and  CurrentAttack 
[2014.07.18-18.55.59:796][ 94]LogBlueprint:Warning: [compiler] Warning Type mismatch between pins  CurrentAttack  and  AsBP_Attack_Turbo_C 
[2014.07.18-18.55.59:797][ 94]LogBlueprint:Warning: [compiler] Warning Type mismatch between pins  Target  and  CurrentAttack_Sheild 
[2014.07.18-18.55.59:797][ 94]LogBlueprint:Warning: [compiler] Warning Type mismatch between pins  Target  and  CurrentAttack_Sheild 
[2014.07.18-18.55.59:797][ 94]LogBlueprint:Warning: [compiler] Warning Type mismatch between pins  CurrentAttack_Sheild  and  Target 
[2014.07.18-18.55.59:797][ 94]LogBlueprint:Warning: [compiler] Warning Type mismatch between pins  CurrentAttack_Sheild  and  Target 
[2014.07.18-18.55.59:813][ 94]LogBlueprint:Warning: [compiler] Warning [0005.13] Compile of BP_QuadCopter_MP_Pawn successful, but with 6 Warning(s) [in 38 ms]

After some more testing, the workaround allows for the compile, but the functions do not work as expected and eventually the game crashes. :confused:

Hello,

Thank you for your report. We were not able to investigate this on the engine version you reported, but there have been many version changes to UE4 since this question was first posted. With a new version of the Engine comes new fixes and it is possible that this issue has changed or may no longer occur. Due to timetable of when this issue was first posted, we are marking this post as resolved for tracking purposes.

If you are still experiencing the issue you reported in the current engine version, then please respond to this message with additional information and we will investigate as soon as possible. If you are experiencing a similar, but different issue at this time, please submit a new report for it.

Thank you

Same problem here, using 4.6.1. I Have “Person” blueprint that is child of “Character” class. Then i have “Player” class that is child of “Person” class. Everything is ok when PIE, but packaging shows these “type mismatch” warnings and it’s not working properly. Unreal has some serious problems with using basic object-oriented structure, another example: https://answers.unrealengine.com/questions/158355/no-animation-caused-by-a-simple-setup-demo-project.html

Hey Slavq-

What exactly do you mean by “not working properly”? Do the same warnings appear if you play in a standalone game or do they only appear when packaging? Any additional information you can include as far as what the exact issue is will help investigating and resolving the problem.

Cheers

For example, my player character disappears, UMG UI widgets are wrong (HP bar is empty, so probably function responsible for getting players’ HP is not wroking) … A lot of things just don’t work :slight_smile:

I have a workaround (in my case i’ve reorganized class structure to eliminate these errors) so it’s working when packaged and in Editor, but still not in Standalone. So i’ve managed to make it work, but the problem is still there.

It was too complicated and i don’t have clear repro steps here, but the problem is similar to the one that i’ve linked in my previous comment - and there i’ve posted repro steps and even a sample project with this bug. Generally, there is some problem with referencing derived blueprints.

's original post was in regards to the derived blueprints being unable to compile. Though your issue sounds similar, there are some differences. I did confirm the bug you mentioned in your other post (the animation not playing in a child blueprint) and answered there.

Cheers

,

I have a project in 4.10.4 that is exhibiting the same behavior - compiling and running with PIE works fine, but packaging the project fails during cooking as it insists that a child class isn’t compatible with its parent class. 's workaround of casting the spawned child to its own class ultimately gets it working both with PIE and packaging. The workaround, however, generates tons of warnings and makes the blueprint compiler prefer to not automatically save any blueprint where I’m using this workaround (despite that fact that I can’t get it to work without doing it that way).

I made a backup of my project where the error was occurring before I did lots of code changes and ended up implementing the workaround stated above - would you guys be interested in that project to investigate?

Hey KovaaK-

Though your issue does sound similar, the changes in recent engine versions make it unlikely that it is exactly the same. In order to investigate your problem it would be best if you can make a new post for the specific issue you’re having, and include a zip of the sample project you mentioned and as much information as possible.

Fair enough. I’ve opened another issue on https://answers.unrealengine.com/questions/392367/failed-building-connection-child-reference-is-not.html to follow-up, and I’ll have a copy of the project online for you guys to dig through soon.

Have a good one,
-KovaaK