This still works, just like before the BeginPlay works normally. But while debugging I found the error (but not the solution):
For some reason when I press my spacebar my jump function gets called so many times that I reach stackoverflow, it’s like it’s in a infinite loop of being called. Tried with a log and I got a thousand of lines for a simple spacebar pressed once.
I am not sure why this is happening, maybe I got something wrong, my code is the following:
// Called to bind functionality to input
void AMovementBasedCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
PlayerInputComponent->BindAxis("Move Forward / Backward", this, &AMovementBasedCharacter::MoveForward);
PlayerInputComponent->BindAxis("Move Right / Left", this, &AMovementBasedCharacter::MoveRight);
PlayerInputComponent->BindAxis("Turn Right / Left Gamepad", this, &AMovementBasedCharacter::MoveRight);
PlayerInputComponent->BindAxis("Look Up / Down Mouse", this, &AMovementBasedCharacter::LookUp);
PlayerInputComponent->BindAxis("Look Up / Down Gamepad", this, &AMovementBasedCharacter::LookUp);
PlayerInputComponent->BindAxis("Turn Right / Left Mouse", this, &AMovementBasedCharacter::Turn);
PlayerInputComponent->BindAxis("Turn Right / Left Gamepad", this, &AMovementBasedCharacter::Turn);
PlayerInputComponent->BindAction("Jump", IE_Pressed, this, &AMovementBasedCharacter::Jump);
}
void AMovementBasedCharacter::Jump()
{
ParkourComponent->Jump(ForwardAxis, RightAxis);
}