Hello community,
I wanted to test something during my current project and started a clean project with a very little, basic code fragment.
Unfortunately, as soon as i create a blueprint class from it, place it in an empty level and hit ‘Play’ it crashes. Anyone able to explain the reason behind that crash to me? I cant find it.
.h:
UCLASS(Blueprintable)
class BASICCODE_API AGridNode : public AActor
{
GENERATED_BODY()
public:
AGridNode(const FObjectInitializer& ObjectInitializer);
protected:
UTextRenderComponent* m_north_text_component;
USceneComponent* m_scene_component;
};
.cpp
AGridNode::AGridNode(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer),
m_scene_component(0),
m_north_text_component(0)
{
m_scene_component = CreateDefaultSubobject<USceneComponent>(TEXT("SceneComp"));
RootComponent = m_scene_component;
m_north_text_component = CreateDefaultSubobject<UTextRenderComponent>(TEXT("NorthTextComp"));
m_north_text_component->bVisible = true;
m_north_text_component->bHiddenInGame = true;
m_north_text_component->SetText(FString("North"));
m_north_text_component->RelativeLocation = FVector(0, -100, 0);
m_north_text_component->RelativeRotation = FRotator(90, 0, -90);
m_north_text_component->AttachTo(m_scene_component);
}
Debugger attached and it crashes in USceneComponent.cpp / line 914 ‘Template Mismatch during attachment.’
edit: running v4.7.1
I’m really out of ideas here.
best regards,
- Christoph -