[4.7]Weird bug only happens in C++ based

This doesn’t happen in Blueprint based game.

I created a game by using a template ‘side scroll 3d’ based on C++.
In SideScrollerCharacter blueprint, I added a event ‘Event hit’.

And then I compiled.

Editor started to take up to about 3gb memory. While doing it, editor didn’t respond(like in infinity loop).
A few seconds after, Editor came back.

Hey ,

When I create a C++ 3D Sidescroller template and add an ‘Event Hit’ in the SideScrollerCharacter blueprint (and compile the blueprint), I don’t see this no-response or anything unusual. Does it happen every time you try it, or did it only happen once?

It’s possible this is related to your hardware. Could you upload your dxdiag (assuming you’re on Windows)?

I found a log.

LogOutputDevice: === Handled error: ===
Ensure condition failed: false [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.7\Engine\Source\Runtime\Engine\Private\SceneComponent.cpp] [Line: 914]
Template Mismatch during attachment. Attaching instanced component to template component. Parent ‘CameraBoom’ Self ‘SideViewCamera’

That’s very helpful - it turns out this is a known issue in 4.7, tracked as UE-9861. We’re hoping to have it fixed by 4.8.

Thanks for your report!

Any progress? I still have this problem in 4.10.

Hey -

Could you elaborate on how this is still affecting you? Are you seeing a long load time when compiling a blueprint inside a code project as reported originally? If so can you give a specific example of where this is occurring? Does the same thing happen in a new project with no added content?

I don’t.

The C++ side scroller template has something like this:

// Create a camera and attach to boom
	SideViewCameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("SideViewCamera"));
	SideViewCameraComponent->AttachTo(CameraBoom, USpringArmComponent::SocketName);
	SideViewCameraComponent->bUsePawnControlRotation = false;

Sometimes after running the game in the editor, it leads to this:

"Ensure condition failed: false [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.10\Engine\Source\Runtime\Engine\Private\Components\SceneComponent.cpp] [Line: 1212] 
Template Mismatch during attachment. Attaching instanced component to template component. Parent 'CameraBoom' Self 'SideViewCamera'
UE4Editor.exe has triggered a breakpoint."

I don’t use the template anymore, but I need the same thing, so would be cool to know if it is a bug in the engine or I should do this attachment in a different way.

Thanks :slight_smile:

The ensure message that is being triggered is more of a warning message that something may go wrong but isn’t an issue at the moment. In this case it appears that there is an issue with the order that components are being created which is causing the ensure. You should be okay to use the setup from the template as a basis in your project.

Can confirm that happend to me a couple times now on 4.11 with the C++ Sidescroller template and it crashes the Editor. Cant reproduce it because it occours randomly.

EDIT: I could nail down the Problem a bit more. It only occours if a SidescrollerCharacter is placed in the World, Auto Posses by Player0, start to modify the BP and hit Compile. First you get some warnings (no crash) in the Console. Starting the Game Camera is not attached to the Character. On Stopping the PIE it crashes.

Note: Sometimes it still works. Changing the BP without clicking Compile (just needs to be in dirty state) seems to trigger it more often. Still very random but can be reproduced

link text

Hey -

I was able to reproduce the crash after editing the character blueprint and have entered a bug report (UE-29046) for further investigation.

Cheers