I have little class Pickup_Weapon:
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "Weapons/Pickup.h"
#include "Weapons/Weapons.h"
#include "Pickup_Weapon.generated.h"
/**
*
*/
UCLASS()
class SHOOTER_API APickup_Weapon : public APickup
{
GENERATED_UCLASS_BODY()
void PostInitializeComponents() override;
UPROPERTY(VisibleDefaultsOnly, Category = Weapon)
AWeapon* Weapon;
UPROPERTY(VisibleDefaultsOnly, Category = Tooltip)
TSubobjectPtr<UTextRenderComponent> Tooltip;
void ShowTooltip(AMyCharacter* ToWho) override;
};
…and everytime i try to run editor with Tooltip declaration uncommented it crashes. This doesn’t happen when i replace UTextRenderComponent with eg. UStaticMeshComponent i works like charm. Is there any way to fix this?
EDIT: Previous answer to myself:
Eh, i can’t belive i’m writing this - I was running editor from VS i DebugGame Editor, so when it crashed i didn’t get crash report program, VS just throwed a breakpoint and i saw a messy CallStack. When today I looked at output in VS, it had normal, human-readable error messages, so i figured out what was causing it.
You have to init your components using PCIP.CreateDefaultSubobject.
And now when i try to move Tooltip in blueprint editor, whole editor crashes with
The thread 0x1a8c has exited with code 0 (0x0).
The thread 0x17dc has exited with code 0 (0x0).
Ensure condition failed: SelectedTemplate->HasAnyFlags(RF_DefaultSubObject) [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.5\Engine\Source\Editor\Kismet\Private\SCSEditorViewportClient.cpp] [Line: 457]