Я создаю игру Simple escape the room, используя Unreal 4.20 и C ++ на моей Windows 10 Machine.Код строит / соответствует просто отлично, но когда я нажимаю play, Engines вылетает.Я попытался перезагрузить компьютер, удалив все файлы, файлы и каталоги, кроме config, content, исходных папок и файла .uproject.Я попытался удалить движок, но он не пускает меня из-за прав администратора.В настоящее время я учусь в классе «Открытая дверь»
Вот мой файл OpenDoor.h:
#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "Engine/TriggerVolume.h"
#include "OpenDoor.generated.h"
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class BUILDINGESCAPE_API UOpenDoor : public UActorComponent
{
GENERATED_BODY()
public:
// Sets default values for this component's properties
UOpenDoor();
protected:
// Called when the game starts
virtual void BeginPlay() override;
private:
void OpenDoor();
// Called every frame
virtual void TickComponent(float DeltaTime, ELevelTick TickType,
FActorComponentTickFunction* ThisTickFunction) override;
public:
UPROPERTY(VisibleAnywhere)
float OpenAngle = 90.0f;
UPROPERTY(EditAnywhere)
ATriggerVolume* PressurePlate;
UPROPERTY(EditAnywhere)
AActor* ActorThatOpens; // Remember pawn inherits from actor
};
Вот мой файл OpenDoor.cpp:
// Fill out your copyright notice in the Description page of Project Settings.
#include "OpenDoor.h"
// Sets default values for this component's properties
UOpenDoor::UOpenDoor()
{
// Set this component to be initialized when the game starts, and to be
ticked every frame. You can turn these features
// off to improve performance if you don't need them.
PrimaryComponentTick.bCanEverTick = true;
// ...
}
// Called when the game starts
void UOpenDoor::BeginPlay()
{
Super::BeginPlay();
// ...
}
void UOpenDoor::OpenDoor()
{
// Find the owning Actor
AActor* Owner = GetOwner();
}
// Called every frame
void UOpenDoor::TickComponent(float DeltaTime, ELevelTick TickType,
FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
// Poll the Trigger Volume
// If the ActorThatOpens is in the volume
if (PressurePlate->IsOverlappingActor(ActorThatOpens))
{
OpenDoor();
}
}
Я новичок в Unreal и борюсь с C ++ как с языком в целом, поэтому мне интересно, если это проблема с моим кодом.Любая помощь будет принята с благодарностью.Спасибо!