diff --git a/Source/ALSV4_CPP/Private/Components/ALSMantleComponent.cpp b/Source/ALSV4_CPP/Private/Components/ALSMantleComponent.cpp index 607cc057..6af49def 100644 --- a/Source/ALSV4_CPP/Private/Components/ALSMantleComponent.cpp +++ b/Source/ALSV4_CPP/Private/Components/ALSMantleComponent.cpp @@ -129,6 +129,17 @@ void UALSMantleComponent::MantleStart(float MantleHeight, const FALSComponentAnd OwnerCharacter->GetCharacterMovement()->SetMovementMode(MOVE_None); OwnerCharacter->SetMovementState(EALSMovementState::Mantling); + + //Check Physics for security + if (MantleLedgeLS.Component.Get()->IsSimulatingPhysics()) { + PhysicActor = true; + MantleLedgeLS.Component.Get()->SetSimulatePhysics(false); + } + else { + PhysicActor = false; + } + + // Step 6: Configure the Mantle Timeline so that it is the same length as the // Lerp/Correction curve minus the starting position, and plays at the same speed as the animation. // Then start the timeline. @@ -385,6 +396,10 @@ void UALSMantleComponent::MantleEnd() { Cast(OwnerCharacter)->UpdateHeldObject(); } + + if (PhysicActor) { + MantleLedgeLS.Component.Get()->SetSimulatePhysics(true); + } } // Enable ticking back after mantle ends diff --git a/Source/ALSV4_CPP/Public/Components/ALSMantleComponent.h b/Source/ALSV4_CPP/Public/Components/ALSMantleComponent.h index 6113b6fc..8db23b18 100644 --- a/Source/ALSV4_CPP/Public/Components/ALSMantleComponent.h +++ b/Source/ALSV4_CPP/Public/Components/ALSMantleComponent.h @@ -106,6 +106,9 @@ class ALSV4_CPP_API UALSMantleComponent : public UActorComponent UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "ALS|Mantle System") float AcceptableVelocityWhileMantling = 10.0f; + UPROPERTY() + bool PhysicActor; + private: UPROPERTY() TObjectPtr OwnerCharacter;