UE 5.3.2 错误解决合集
在跟随Udemy课程《Unreal Engine 5 C++ The Ultimate Game Developer Course》的过程中,碰到了各种因为UE本身或者版本问题导致即使步骤一致,但执行一直出错的情况,遂列举出来,希望对同样碰到这些问题的伙伴有所帮助。
Build报错 “BuildGraph.Automation.csproj” – FAILED等
在升级完Unreal Engine到版本5.3.2之后,发现即使用UE自带的空Actor Class进行编译都有俩项如下报错:1
2
3========== Build: 46 succeeded, 2 failed, 0 up-to-date, 1 skipped ==========
Done building project “BuildGraph.Automation.csproj” – FAILED.
Done building project “AutomationScripts.Automation.csproj” – FAILED.
解决办法为修改UE的源文件:
- 找到安装Unreal Engine Machine的文件夹,我的是
D:\App\UnrealEngine Machines\UE_5.3\
- 到
Engine\Source\Programs\AutomationTool\BuildGraph\BgScriptReader.cs
中将1640行改为:1
2
3
4if (users != null)
{
report.NotifyUsers.UnionWith(users);
} - 到
Engine/Source/Programs/AutomationTool/Scripts/CheckForHacks.cs
中将87行改为:Logger.LogInformation("Scanning files... [{Arg0}]", FilesToCheck.Count);
即可编译通过。
后话:
非常建议开启UE自带的Revision Control功能,这样可以备份自己的游戏项目,同时用自己的硬盘再备份一份。因为如果不小心彻底删掉了.uproject
文件,那么似乎就得重新从头做一遍。(我暂时没找到解决方法,如果有知道的大佬麻烦告知 :>~)
Tick 失效每帧无改变
在课程中原本代码为PrimaryActorTick.bCanEverTick = true;
但这个并没用,即使更改了 void AItem::Tick(float DeltaTime)
函数,里面的内容在UE运行后没有任何显示。应该更改的是bStartWithTickEnabled
参数:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16AItem::AItem()
{
// 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;
PrimaryActorTick.bStartWithTickEnabled = true; // Changed code
}
// Called every frame
void AItem::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
if (GEngine)
{
GEngine->AddOnScreenDebugMessage(1, 60.f, FColor::Cyan, FString::Printf(TEXT("DeltaTime: %f"), DeltaTime));
}
}
或者,如果只用蓝图Blueprint,那么需要在“Event Tick”node节点上,Exec连接”Set Actor Tick Enabled”,并将“Enabled”勾上即可。
Build报错function override error
如果在下面这些function或者更多地方出现”Member function declared with ‘override’ does not override a base class member”错误。而你又没有更改过它们这些function。1
2
3
4
5
6
7virtual bool SerializeBulkData(class FBulkData& BulkData, const struct FBulkDataSerializationParams& Params) override
virtual bool SetCompressionMap(TArray<FCompressedChunk>* CompressedChunks, ECompressionFlags CompressionFlags) override
virtual FArchive& operator<<(FLazyObjectPtr& Value) override { return SerializeLazyObjectPtr(*this, Value); }
virtual FArchive& operator<<(FObjectPtr& Value) override { return SerializeObjectPtr(*this, Value); }
virtual FArchive& operator<<(FSoftObjectPtr& Value) override { return SerializeSoftObjectPtr(*this, Value); }
virtual FArchive& operator<<(FSoftObjectPath& Value) override { return SerializeSoftObjectPath(*this, Value); }
virtual FArchive& operator<<(FWeakObjectPtr& Value) override { return SerializeWeakObjectPtr(*this, Value); }
那么就是UE的live coding在捣鬼。回到UE界面中,找到右下角像“俄罗斯方块”的标志,鼠标移到上面显示“Recompiles and reloads C++ blabla”, 点右边三个点,关掉live coding就好了。之后编译直接点一下这个按钮就行。(不知UE为啥这么多bug)