From 7d79416afca78841e8e76353ad1a39faba10d0ed Mon Sep 17 00:00:00 2001 From: Kothore <100525076+KothoreBornalex@users.noreply.github.com> Date: Fri, 8 Mar 2024 19:53:41 +0100 Subject: [PATCH] Commit Fix --- .../Private/Components/ALSMantleComponent.cpp | 15 +++++++++++++++ .../Public/Components/ALSMantleComponent.h | 3 +++ 2 files changed, 18 insertions(+) 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;