Remove flying context
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -536,20 +536,6 @@ void AEleriPlayerController::OnStartFlyingAction(const FInputActionValue &Value)
|
|||||||
MovementComponent->SetMovementMode(EMovementMode::MOVE_Walking);
|
MovementComponent->SetMovementMode(EMovementMode::MOVE_Walking);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UEnhancedInputLocalPlayerSubsystem *Subsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(GetLocalPlayer()))
|
|
||||||
{
|
|
||||||
// PawnClientRestart can run more than once in an Actor's lifetime, so start by clearing out any leftover mappings.
|
|
||||||
if (bFlying)
|
|
||||||
{
|
|
||||||
Subsystem->RemoveMappingContext(MovementContext);
|
|
||||||
Subsystem->AddMappingContext(FlyingContext, 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Subsystem->RemoveMappingContext(FlyingContext);
|
|
||||||
Subsystem->AddMappingContext(MovementContext, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (PlayerCharacter)
|
if (PlayerCharacter)
|
||||||
{
|
{
|
||||||
PlayerCharacter->ToggleBroomActor(bFlying);
|
PlayerCharacter->ToggleBroomActor(bFlying);
|
||||||
|
|||||||
@@ -184,8 +184,6 @@ public:
|
|||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly, Category = "Locomotion Input")
|
UPROPERTY(EditDefaultsOnly, Category = "Locomotion Input")
|
||||||
UInputAction* StartFlyingAction;
|
UInputAction* StartFlyingAction;
|
||||||
UPROPERTY(EditDefaultsOnly, Category = "Locomotion Input")
|
|
||||||
UInputMappingContext* FlyingContext;
|
|
||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly, Category = "UI Input")
|
UPROPERTY(EditDefaultsOnly, Category = "UI Input")
|
||||||
UInputMappingContext* UiContext;
|
UInputMappingContext* UiContext;
|
||||||
|
|||||||
Reference in New Issue
Block a user