Hey all, I’ve been tackling communication between C++ actors for a while now, and I’m working on making interfaces work. I’ve followed the guide that posted and the docs, and it won’t work.
I think the problem is that it won’t recognize a UINTERFACE as a class. Also, I get the error
cannot open source file “FuncitonHandling.generated.h”" and I’m not really sure why… Any help would be appreciated, I’ve been stuck on this for hours.
FunctionHandling.h
#pragma once
#include "FunctionHandling.generated.h"
UINTERFACE(Blueprintable)
class UFunctionHandling : public UInterface
{
GENERATED_UINTERFACE_BODY()
};
class IFunctionHandling
{
GENERATED_IINTERFACE_BODY()
public:
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = "Functions")
FVector Move();
};
Try this… Close the solution. Go into the folder location where the VS solution is, and you’ll see an “Unreal Engine Project File”. Right click on it and select “Generate Visual Studio project files”
Your error list shows “OtherCompilationError(5)”. If you switch to the Output tab, you should be able to find the specific error that is causing this to show. Please post a screenshot of your output tab to provide more information.
I’ve actually found a tutorial that sort of works. I got to the part where I had to implement the interface and that’s where something’s gone wrong. I also get the OtherCompilationError (5), so I’ll add that as well.
FunctionInterface.h
#pragma once
#include "FunctionInterface.generated.h"
UINTERFACE(Blueprintable, MinimalAPI)
class UFunctionInterface : public UInterface
{
GENERATED_UINTERFACE_BODY()
};
class IFunctionInterface
{
GENERATED_IINTERFACE_BODY()
public:
UFUNCTION(BlueprintCallable,BlueprintNativeEvent, Category = "Functions")
float FunctionFloat01();
};
Looking at the output log and the code provided, the error appears to be caused by the FunctionFloat01_Implementation declaration in BaseTest.h. As stated in line 5 of the output, the function cannot be declared as virtual function and a BlueprintNativeEvent at the same time. If you are trying to override the function in a child class then I would remove BlueprintNativeEvent from BaseTest and only include it in the overridden children.