I am trying to make a blueprint function that does not have the target input like BlueprintCallable does. Thus I am using BlueprintPure instead, but it can’t compile for some reason.
Edit: Just to be clear, BlueprintCallable does compile but “BlueprintCallable, BlueprintPure” cause a compile error and so does just BlueprintPure.
.h
#pragma once
#include "GameFramework/Actor.h"
#include "HitTester.generated.h"
UCLASS()
class HITORIENTATION_API AHitTester : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AHitTester();
// Called when the game starts or when spawned
virtual void BeginPlay() override;
// Called every frame
virtual void Tick( float DeltaSeconds ) override;
UFUNCTION(BlueprintCallable, BlueprintPure, Category = testCat)
void CallTest(FVector testinput);
};
.cpp
#include "HitOrientation.h"
#include "HitTester.h"
// Sets default values
AHitTester::AHitTester()
{
// 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 AHitTester::BeginPlay()
{
Super::BeginPlay();
}
// Called every frame
void AHitTester::Tick( float DeltaTime )
{
Super::Tick( DeltaTime );
}
void AHitTester::CallTest(FVector testinput)
{
UE_LOG(LogTemp, Warning, TEXT("Called?! %s"), *testinput.ToString());
}
Errors
Severity Code Description Project File Line
Error code OtherCompilationError (5) HitOrientation D:\Unreal Projects\HitOrientation\Intermediate\ProjectFiles\Error 1
Error MSB3073 The command ""D:\Programs\Epic Games\4.10\Engine\Build\BatchFiles\Build.bat" HitOrientationEditor Win64 Development "D:\Unreal Projects\HitOrientation\HitOrientation.uproject" -rocket -waitmutex -2015" exited with code -1. HitOrientation C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets 37
The errors it gives if I take out BlueprintCallable:
Severity Code Description Project File Line
Error (active) name followed by '::' must be a class or namespace name HitOrientation d:\Unreal Projects\HitOrientation\Source\HitOrientation\HitTester.cpp 28
Error MSB3073 The command ""D:\Programs\Epic Games\4.10\Engine\Build\BatchFiles\Build.bat" HitOrientationEditor Win64 Development "D:\Unreal Projects\HitOrientation\HitOrientation.uproject" -rocket -waitmutex -2015" exited with code -1. HitOrientation C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets 37
Error code OtherCompilationError (5) HitOrientation D:\Unreal Projects\HitOrientation\Intermediate\ProjectFiles\Error 1
Error (active) name followed by '::' must be a class or namespace name HitOrientation d:\Unreal Projects\HitOrientation\Source\HitOrientation\HitTester.cpp 6
Error (active) name followed by '::' must be a class or namespace name HitOrientation d:\Unreal Projects\HitOrientation\Source\HitOrientation\HitTester.cpp 14
Error (active) name followed by '::' must be a class or namespace name HitOrientation d:\Unreal Projects\HitOrientation\Source\HitOrientation\HitTester.cpp 21
Error (active) this declaration has no storage class or type specifier HitOrientation d:\Unreal Projects\HitOrientation\Source\HitOrientation\HitTester.h 6
Error (active) expected a ';' HitOrientation d:\Unreal Projects\HitOrientation\Source\HitOrientation\HitTester.h 7