Just got Unreal and trying to figure out what’s making my character jump (just so I know how to set inputs and such and to generally just learn the engine). I opened up a “Code First Person Shooter” template. I looked in the Character.cpp file and found a function that seems to be handling the input bindings. Ok cool. So I look at it and it all makes sense however I don’t see where the keys are actually being binded. Where is it that “space” = jump? or Mouse click = shoot? Again, just trying to get mess around with Unreal at the moment so please excuse my ignorance here I just can’t seem to find where the actual keys are being inputted.
void APlaygroundCharacter::SetupPlayerInputComponent(class UInputComponent* InputComponent)
{
// set up gameplay key bindings
check(InputComponent);
InputComponent->BindAction("Jump", IE_Pressed, this, &ACharacter::Jump);
InputComponent->BindAction("Fire", IE_Pressed, this, &APlaygroundCharacter::OnFire);
InputComponent->BindTouch(EInputEvent::IE_Pressed, this, &APlaygroundCharacter::TouchStarted);
InputComponent->BindAxis("MoveForward", this, &APlaygroundCharacter::MoveForward);
InputComponent->BindAxis("MoveRight", this, &APlaygroundCharacter::MoveRight);
// We have 2 versions of the rotation bindings to handle different kinds of devices differently
// "turn" handles devices that provide an absolute delta, such as a mouse.
// "turnrate" is for devices that we choose to treat as a rate of change, such as an analog joystick
InputComponent->BindAxis("Turn", this, &APawn::AddControllerYawInput);
InputComponent->BindAxis("TurnRate", this, &APlaygroundCharacter::TurnAtRate);
InputComponent->BindAxis("LookUp", this, &APawn::AddControllerPitchInput);
InputComponent->BindAxis("LookUpRate", this, &APlaygroundCharacter::LookUpAtRate);
}