Hi.
I want to move player up when pressing button until releasing it.
I have bind the actions:
InputComponent->BindAction("Fly", IE_Pressed, this, &AFpsCodeCharacter::Fly);
InputComponent->BindAction("Fly", IE_Released, this, &AFpsCodeCharacter::StopFlying);
and made two methods:
void AFpsCodeCharacter::Fly() {
bIsFlying = true;
}
void AFpsCodeCharacter::StopFlying() {
bIsFlying = false;
}
And I need something like this:
void AFpsCodeCharacter::Update(float DeltaTime) {
if (bIsFlying) {
LaunchCharacter(FVector(0, 0, 1000 * DeltaTime), false, false);
}
}