Hello all, I noticed a widget “Input Key Selector” in UMG, and seems to work (at least the basic functionality), but the selected key is a struct called “Input Chord”, and breaking it in blueprints doesn’t give you anything. So I decided to make my own function and export it to blueprints, but I can’t compile it for some reason, I am getting link errors.
Here’s the code I have:
Header:
#pragma once
#include "Kismet/BlueprintFunctionLibrary.h"
#include "CFunctions.generated.h"
/**
*
*/
UCLASS()
class SURVIVALNEW_API UCFunctions : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintPure, Category = "Input")
static FKey KeyFromInputChord(FInputChord Chord);
};
Cpp:
#include "SurvivalNew.h"
#include "CFunctions.h"
FKey UCFunctions::KeyFromInputChord(FInputChord Chord)
{
return Chord.Key;
}
What am I doing wrong here?
EDIT: Some of the errors:
Failed to produce item: L:\Unreal Projects\SurvivalNew\Binaries\Win64\UE4Editor-SurvivalNew.dll SurvivalNew L:\Unreal Projects\SurvivalNew\Intermediate\ProjectFiles\ERROR
unresolved external symbol "__declspec(dllimport) public: __cdecl FInputChord::FInputChord(void)" (__imp_??0FInputChord@@QEAA@XZ) SurvivalNew L:\Unreal Projects\SurvivalNew\Intermediate\ProjectFiles\SurvivalNew.generated.cpp.obj
unresolved external symbol "__declspec(dllimport) public: __cdecl FInputChord::FInputChord(struct FInputChord const &)" (__imp_??0FInputChord@@QEAA@AEBU0@@Z) SurvivalNew L:\Unreal Projects\SurvivalNew\Intermediate\ProjectFiles\SurvivalNew.generated.cpp.obj
unresolved external symbol "__declspec(dllimport) public: __cdecl FInputChord::~FInputChord(void)" (__imp_??1FInputChord@@QEAA@XZ) SurvivalNew L:\Unreal Projects\SurvivalNew\Intermediate\ProjectFiles\SurvivalNew.generated.cpp.obj
unresolved external symbol "__declspec(dllimport) class UScriptStruct * __cdecl Z_Construct_UScriptStruct_FInputChord(void)" (__imp_?Z_Construct_UScriptStruct_FInputChord@@YAPEAVUScriptStruct@@XZ) referenced in function "class UFunction * __cdecl Z_Construct_UFunction_UCFunctions_KeyFromInputChord(void)" (?Z_Construct_UFunction_UCFunctions_KeyFromInputChord@@YAPEAVUFunction@@XZ) SurvivalNew L:\Unreal Projects\SurvivalNew\Intermediate\ProjectFiles\SurvivalNew.generated.cpp.obj