我的ue4也崩了,跟老师的一样。。
我的ue4也崩了,跟老师的一样。。
如何解决崩溃问题,在文件夹中可删除文件
.vs
Binaries
Intermediate
Save()
以及VS工程
如果还是不行的话,可以把原文件中的Content中
一个文件中Content以及Source不能删除,主要的东西在这两个文件夹中
这三个文件夹不能删除:Config、Content、Source
这些文件夹及文件都能删除:.vs、Binaries、Intermediate、Saved、UnrealEngineProject.sln
重新打开,需要重新生成,点“是”
Content、Source不能删除
属性的初始化放在BeginPlay()
DefaultPawn = GetWorld()->GetFirstPlayerController()->GetPawn();
这里居然报错,害我找了半天,原来只要编译成功了就行
解决奔溃问题
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;
Owner = GetOwner();
DefaultPawn = GetWorld()->GetFirstPlayerController()->GetPawn();
}
初始化不能放在构造函数中,要放在BeginPlay()中。