Hi brothers, i have very strange problem i searched a lot to fix it but unfortunately nothing !!
I created SM_Door in my Editor with costume Actor class which is name “Door” to fire some events like open and close.
The Problem is, When i open UE4 Editor and that loads up to 75% loading… the UE editor is crashing, really i don’t know why !!
The Code of Door Header file is:
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "GameFramework/Actor.h"
#include "Door.generated.h"
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class MAZE_API UDoor : public UActorComponent
{
GENERATED_BODY()
public:
// Sets default values for this component's properties
UDoor();
void Open();
void Close();
bool IsOverlapping(AActor*);
protected:
// Called when the game starts
virtual void BeginPlay() override;
public:
// Called every frame
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
};
Then i created Runner class representing the default player:
The Code of Runner Header file and calling instance of Door class in like this:
#include "Door.h"
private:
UDoor Door;
The Full Code is:
#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "Engine/World.h"
#include "Door.h"
#include "GameFramework/Actor.h"
#include "Runner.generated.h"
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class MAZE_API URunner : public UActorComponent
{
GENERATED_BODY()
public:
// Sets default values for this component's properties
URunner();
protected:
// Called when the game starts
virtual void BeginPlay() override;
public:
// Called every frame
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
void IsNearToDoor();
void IsNearToLampKey();
private:
void SetupComponents();
UDoor Door;
AActor* Runner = nullptr;
};