Was scoping a cool little tutorial in C++ and Paper2D, not the best at the C++ and was wondering if someone might point something out I might have mistaken?
.h
public:
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
UCapsuleComponent* CapsuleComp;
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
UPaperFlipbookComponent* CharacterFB;
UPROPERTY(EditAnywhere, BlueprintReadOnly)
UInputMappingContext* InputMappingContext;
UPROPERTY(EditAnywhere, BlueprintReadOnly)
UInputAction* MoveAction;
UPROPERTY(EditAnywhere, BlueprintReadOnly)
UInputAction* ShootAction;
ATDCharacter();
virtual void BeginPlay() override;
virtual void Tick(float DeltaTime) override;
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
void MoveTriggered(const FInputActionBinding& Value);
void MoveCompleted(const FInputActionBinding& Value);
void Shoot(const FInputActionBinding& Value);
};
all includes are present and the .cpp errors are coming up after the BindAction(…This errors.)
error is:
No viable function.
.cpp offending part
void ATDCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
if (UEnhancedInputComponent *EnhancedInputComponent = Cast<UEnhancedInputComponent>(PlayerInputComponent))
{
EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &ATDCharacter::MoveTriggered);
EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Completed, this, &ATDCharacter::MoveCompleted);
EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Canceled, this, &ATDCharacter::MoveCompleted);
EnhancedInputComponent->BindAction(ShootAction, ETriggerEvent::Started, this, &ATDCharacter::Shoot);
EnhancedInputComponent->BindAction(ShootAction, ETriggerEvent::Triggered, this, &ATDCharacter::Shoot);
}
}
void ATDCharacter::MoveTriggered(const FInputActionBinding& Value)
{
FVector2D MoveActionValue = Value.Get<FVector2D>();
GEngine->AddOnScreenDebugMessage(-1, 2.0f, FColor::White, MoveActionValue.ToString());
}
void ATDCharacter::MoveCompleted(const FInputActionBinding& Value)
{
GEngine->AddOnScreenDebugMessage(-1, 2.0f, FColor::Green, TEXT("MoveCompleted"));
}
void ATDCharacter::Shoot(const FInputActionBinding& Value)
{
GEngine->AddOnScreenDebugMessage(-1, 2.0f, FColor::Red, TEXT("Shoot"));
}
am I missing something or is it right in front of me…??