AShooterCharacter::Jump rather than ACharacter::Jump

Since our ShooterCharacter inherits from the ACharacter class, Rider just straight up suggested “Jump” right away from the class we’re creating when setting up binds. So wouldn’t it be better to bind to our inherited Jump function, especially in case we later decide to override it and add more functionality? Or does it matter?

PlayerInputComponent->BindAction(TEXT("Jump"), IE_Pressed, this, &AShooterCharacter::Jump);

instead of

PlayerInputComponent->BindAction(TEXT("Jump"), IE_Pressed, this, &ACharacter::Jump);

It doesn’t matter as it’s a virtual function and will dispatch to the correct function either way.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms