Why is this code kills the project? irretrievably
File.h
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "GameFramework/Actor.h"
#include "MyBlock.generated.h"
UCLASS()
class BLOCKS_API AMyBlock : public AActor
{
GENERATED_BODY()
UPROPERTY()
class UStaticMeshComponent* BlockMesh;
public:
// Sets default values for this actor's properties
AMyBlock();
// Called when the game starts or when spawned
virtual void BeginPlay() override;
// Called every frame
virtual void Tick(float DeltaSeconds) override;
FORCEINLINE class UStaticMeshComponent* GetBlockMesh() const { return BlockMesh; }
};
File.cpp
#include "Blocks.h"
#include "MyBlock.h"
ConstructorHelpers::FObjectFinderOptional<UStaticMesh> Blok = ConstructorHelpers::FObjectFinderOptional<UStaticMesh>(TEXT("/Game/Blocks_mesh.Blocks_mesh"));
// Sets default values
AMyBlock::AMyBlock()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
// созданеи 3D блока на эране
BlockMesh->CreateDefaultSubobject<UStaticMeshComponent>(TEXT("MYBLOCK"));
//загружаем модель блока из рессурсов
BlockMesh->SetStaticMesh(Blok.Get());
//корень модели
RootComponent = BlockMesh;
}
// Called when the game starts or when spawned
void AMyBlock::BeginPlay()
{
Super::BeginPlay();
}
// Called every frame
void AMyBlock::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
What’s my mistake
Is it possible to restore the project