前几天刚开始进入虚幻引擎,但是当我尝试通过编辑器创建新的actor时,在Visual Studio中立即出现错误。
我根本没有更改任何代码,但收到87个错误。
Here is a picture of some of the errors.
我在下面发布了我的两个actor文件,并随意在带有错误下划线的任何行旁添加注释。这是我对代码所做的唯一更改。
这是我的“ MyActor.h”文件。
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "MyActor.generated.h" //Red underline under '#include'
UCLASS() //Green underline under 'UCLASS'
class BIGFEET_API AMyActor : public AActor
{
GENERATED_BODY() //Red underline under 'GENERATED_BODY'
public:
// Sets default values for this actor's properties
AMyActor();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
};
这是我的“ MyActor.ccp”文件。
// Fill out your copyright notice in the Description page of Project Settings.
#include "MyActor.h"
// Sets default values
AMyActor::AMyActor()
{
// 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;
}
// Called when the game starts or when spawned
void AMyActor::BeginPlay()
{
Super::BeginPlay(); //Red underline under 'BeginPlay'
}
// Called every frame
void AMyActor::Tick(float DeltaTime)
{
Super::Tick(DeltaTime); //Red underline under 'Tick'
}
在进行了一些研究之后,我将假定这是引擎的某种设置问题,我不知道该怎么做。任何帮助将不胜感激!
答案 0 :(得分:0)
大多数错误都有可能在其他帖子中有具体答案,但要关注“过多”问题:
答案 1 :(得分:0)
多亏了Doctorlove,我得以解决我的问题!我必须跟踪错误中列出的所有文件,并将它们的目录添加到VC ++目录下的包含目录列表中。这样做之后,我所有的错误都消失了!