I know its probably a Very easy thing to implement but currently I’m stuck I cant find anything that really helps
Code I’ve tried to far:
Version 1
//cpp
void AMyCharacter::SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent)
{
// Set up gameplay key bindings
check(PlayerInputComponent);
PlayerInputComponent->BindAction("Jump", IE_Pressed, this, &ACharacter::Jump);
PlayerInputComponent->BindAction("Jump", IE_Released, this, &ACharacter::StopJumping);
}
Version 2
//.cpp
void AMyCharacter::SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent)
{
// Set up gameplay key bindings
check(PlayerInputComponent);
PlayerInputComponent->BindAction("Jump", IE_Pressed, this, &APawnTest::Move_ZAxis);
PlayerInputComponent->BindAction("Jump", IE_Released, this, &APawnTest::Move_ZAxis);
}
void APawnTest::Move_ZAxis(float AxisValue)
{
// Move at 100 units per second right or left
CurrentVelocity.Y = FMath::Clamp(AxisValue, -1.0f, 1.0f) * 1000.0f; // note i copyed this for other Axis movement that did work
}
//.h
void Move_ZAxis(float AxisValue);
FVector CurrentVelocity;
Trying both of versions of this code just gives me
:error C2664: ‘FInputActionBinding &UInputComponent::BindAction(const FName,const EInputEvent,UserClass ,void (__cdecl APawnTest:: )(FKey))’: cannot convert argument 4 from ‘void (__cdecl APawnTest::* )(float)’ to ‘void (__cdecl APawnTest::* )(void)’ with { UserClass=APawnTest}
Can anyone help?