I’m having a trouble setting 2D flipbook animation into C++, this problem wasn’t there in the past.
I used to do this method without any problems but now when I do
header:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "FlipbookComponent", meta = (AllowPrivateAccess = "true"))
class UPaperFlipbookComponent * paperComponent;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "FlipbookComponent", meta = (AllowPrivateAccess = "true"))
class UPaperFlipbook* paperSoPWalk;
It’s a compiler error so you need to check the syntax, usually what i do is:
static ConstructorHelpers::FObjectFinder<UClass> PlayerPawnObject(TEXT("/Game/Characters/Scavenger/Player_BP.Player_BP_C"));
if (PlayerPawnObject.Object)
DefaultPawnClass = PlayerPawnObject.Object;
So in your case you can try:
static ConstructorHelpers::FObjectFinder<UPaperFlipbook> PaperFlipbookObject(TEXT("/Game/2DSideScroller/Sprites/RunningAnimation.RunningAnimation")); // If this doesnt work try with "/Game/2DSideScroller/Sprites/RunningAnimation"
if (PaperFlipbookObject.Object)
Class = PaperFlipbookObject.Object;
***Severity Code Description Project File Line Suppression State
Error C2664 ‘void ConstructorHelpers::ValidateObject(UObject *,const FString &,const TCHAR *)’: cannot convert argument 1 from ‘UPaperFlipbook *’ to ‘UObject *’ ManSide3 E:\Program Files\Epic Games\UE_4.18\Engine\Source\Runtime\CoreUObject\Public\UObject\ConstructorHelpers.h 109
Severity Code Description Project File Line Suppression State
Error Failed to produce item: ManSide3 1
Severity Code Description Project File Line Suppression State
Error MSB3075 The command ““E:\Program Files\Epic Games\UE_4.18\Engine\Build\BatchFiles\Build.bat” ManSide3Editor Win64 Development " -waitmutex” exited with code 5. Please verify that you have sufficient rights to run this command. ManSide3 C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets 41***
And the previous code that I used and the one that you suggested me to try:
I thought “PaperFlipbookComponent.h” was enough, like the previous versions of UE4.
I never thought the missing “PaperFlipbook.h” could be the problem.
Thank you so much man, I have been trying to solve this problem for days :).