Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/ALS/Private/AlsCharacter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ void AAlsCharacter::Tick(const float DeltaTime)
RefreshGroundedRotation(DeltaTime);
RefreshInAirRotation(DeltaTime);

StartMantlingInAir();
if (Settings->Mantling.bAutoInAirMantling) StartMantlingInAir();
RefreshMantling();
RefreshRagdolling(DeltaTime);
RefreshRolling(DeltaTime);
Expand Down
3 changes: 2 additions & 1 deletion Source/ALS/Public/AlsCharacter.h
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,10 @@ class ALS_API AAlsCharacter : public ACharacter
UFUNCTION(BlueprintCallable, Category = "ALS|Character", Meta = (ReturnDisplayName = "Success"))
bool StartMantlingGrounded();

private:
UFUNCTION(BlueprintCallable, Category = "ALS|Character", Meta = (ReturnDisplayName = "Success"))
bool StartMantlingInAir();

private:
bool StartMantling(const FAlsMantlingTraceSettings& TraceSettings);

UFUNCTION(Server, Reliable)
Expand Down
4 changes: 4 additions & 0 deletions Source/ALS/Public/Settings/AlsMantlingSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ struct ALS_API FAlsGeneralMantlingSettings
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ALS")
uint8 bAllowMantling : 1 {true};

// If true, the character will automatically try to mantle while in air.
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ALS")
uint8 bAutoInAirMantling: 1 {true};

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ALS", Meta = (ClampMin = 0, ClampMax = 180, ForceUnits = "deg"))
float TraceAngleThreshold{110.0f};

Expand Down
6 changes: 6 additions & 0 deletions Source/ALSExtras/Private/AlsCharacterExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "EnhancedInputSubsystems.h"
#include "Engine/LocalPlayer.h"
#include "GameFramework/PlayerController.h"
#include "Settings/AlsCharacterSettings.h"
#include "Utility/AlsVector.h"

#include UE_INLINE_GENERATED_CPP_BY_NAME(AlsCharacterExample)
Expand Down Expand Up @@ -162,6 +163,11 @@ void AAlsCharacterExample::Input_OnJump(const FInputActionValue& ActionValue)
return;
}

if (!Settings->Mantling.bAutoInAirMantling && LocomotionMode == AlsLocomotionModeTags::InAir && StartMantlingInAir())
{
return;
}

if (StartMantlingGrounded())
{
return;
Expand Down