Hello.
I’m just beginning in UE4 and tried to follow this tutorial.
Therefore, he was done in a older version of UE4, so i had to change some of the lines of this tutorial. My problem is that the code don’t want to compile, I an ouptput that could be traduced like that:
Parsing headers for TestUE4Editor
1> D:/Programmation/TestUE4/Source/TestUE4/PickUp.h(26) : BlueprintReadWrite should not be used on private members
1>Error : Failed to generate code for TestUE4Editor - error code: OtherCompilationError (5)
1> UnrealHeaderTool failed for target 'TestUE4Editor' (platform: Win64, module info: D:\Programmation\TestUE4\Intermediate\Build\Win64\TestUE4Editor\DebugGame\UnrealHeaderTool.manifest).
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command ""D:\Epic Games\4.8\Engine\Build\BatchFiles\Build.bat" TestUE4Editor Win64 DebugGame "D:\Programmation\TestUE4\TestUE4.uproject" -rocket" stopped with the code -1.
I have those errors :
Error 1 error code: OtherCompilationError (5)
Error 2 error MSB3073: The commande ""D:\Epic Games\4.8\Engine\Build\BatchFiles\Build.bat" TestUE4Editor Win64 DebugGame "D:\Programmation\TestUE4\TestUE4.uproject" -rocket" stopped with the code -1.
Error 3 IntelliSense : No instance of the constructor "APickUp::APickUp"match with the list of arguments
As the IntelliSense Error let suppose, i think it’s an error related to my constructor of the class. Therefore, I actually use the right prototype, so it’s really bizarre.
There is my class:
Header :
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "GameFramework/Actor.h"
#include "PickUp.generated.h"
UCLASS()
class TESTUE4_API APickUp : public AActor
{
GENERATED_BODY()
public:
APickUp(const FObjectInitializer& ObjectInitializer);
// Sets default values for this actor's properties
// Called when the game starts or when spawned
virtual void BeginPlay() override;
// Called every frame
virtual void Tick( float DeltaSeconds ) override;
private:
UPROPERTY(EditAnywhere,BlueprintReadWrite, Category = Pickup)
bool isActive;
UPROPERTY(VisibleDfaultOnly,BlueprintREadOnly,Category = Pickup)
USphereComponent *Collider;
UPROPERTY(VisibleDfaultOnly, BlueprintREadOnly, Category = Pickup)
UStaticMeshComponent *PickupMesh;
//UFUNCTION(BlueprintNativeEvent)
void OnPickedUp_Implementation();
};
Class :
// Fill out your copyright notice in the Description page of Project Settings.
#include "TestUE4.h"
#include "PickUp.h"
// Sets default values
APickUp::APickUp(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
isActive = true;
Collider = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(this, TEXT("SphereCollider"));
RootComponent = Collider;
PickupMesh = ObjectInitializer.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("PickupMesh"));
PickupMesh->SetSimulatePhysics(true);
PickupMesh->AttachTo(RootComponent);
// 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 APickUp::BeginPlay()
{
Super::BeginPlay();
}
// Called every frame
void APickUp::Tick( float DeltaTime )
{
Super::Tick( DeltaTime );
}
void APickUp::OnPickedUp_Implementation()
{
}
Do you know where the error(s) come from and how could I solve them ? That said, do you know tutorial with a version of UE >=4.6 to begin more easily ?
Thank you for your help, and I really apologize for my poor English…