Hi,
I want to get all ActionMappings and put them in a struct called FActionInput:
USTRUCT(BlueprintType)
struct FKeyCommand
{
//...
FKeyCommand(const FInputActionKeyMapping& Action)
:
Key(Action.Key),
bShift(Action.bShift),
bCtrl(Action.bCtrl),
bAlt(Action.bAlt)
{
}
};
USTRUCT(BlueprintType)
struct FActionInput
{
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Default")
TArray<FKeyCommand> Keys;
//...
FActionInput(const FInputActionKeyMapping& pAction)
{
//...
}
}
Now, when I want to add some keys:
//TArray<FActionInput>& Inputs
for (const FActionInput& input : Inputs)
{
//...
input.Keys.Add(FKeyCommand(...));
}
I always get that C2663 error. It has something to do with const but I don’t know where I need to remove or add a const without getting less errors. Can you help me?