Hi
I am trying to convert the Crypt Rider project to use enhanced input components in Unreal 5.1 but I get this error:
CryptRaiderCharacter.cpp(91): [C2665] ‘UEnhancedInputComponent::BindAction’: none of the 4 overloads could convert all the argument types
The line of the error:
void ACryptRaiderCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
...
if (UEnhancedInputComponent* EnhancedInputComponent = CastChecked<UEnhancedInputComponent>(PlayerInputComponent))
{
EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &ACryptRaiderCharacter::Move); // error here
}
}
void ACryptRaiderCharacter::Move(FInputActionValue& Value)
{
const float DirectionValue = Value.Get<float>();
if (Controller && DirectionValue != 0.f)
{
FVector Forward = GetActorForwardVector();
AddMovementInput(Forward, DirectionValue);
}
}
Declaration of input action:
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Input)
UInputAction* MoveAction;
What is the problem ?
I tried deleted saved, binaries, Intermediate and compile but I get same error