Implemented basic footsteps
This commit is contained in:
parent
e862d22f5f
commit
da00261121
BIN
Content/Legumix/Player/BP_Play.uasset
(Stored with Git LFS)
BIN
Content/Legumix/Player/BP_Play.uasset
(Stored with Git LFS)
Binary file not shown.
@ -157,6 +157,7 @@ void ULMMovementComponent::EnterSlide()
|
||||
bWantsToCrouch = true;
|
||||
Velocity += Velocity.GetSafeNormal2D() * SlideEnterImpulse;
|
||||
SetMovementMode(EMovementMode::MOVE_Custom, ECustomMovementModes::ECMM_Sliding);
|
||||
OnSlideStarted.Broadcast();
|
||||
}
|
||||
|
||||
void ULMMovementComponent::ExitSlide()
|
||||
@ -167,6 +168,7 @@ void ULMMovementComponent::ExitSlide()
|
||||
FHitResult Hit;
|
||||
SafeMoveUpdatedComponent(FVector::ZeroVector, NewRotation, true, Hit);
|
||||
SetMovementMode(EMovementMode::MOVE_Walking);
|
||||
OnSlideEnded.Broadcast();
|
||||
}
|
||||
|
||||
void ULMMovementComponent::PhysSlide(float DeltaTime, int32 Iterations)
|
||||
|
@ -308,6 +308,7 @@ void ALMPlayer::DoLedgeGrabCheck()
|
||||
|
||||
FVector TeleportLocation = FVector(Hit.Location.X, Hit.Location.Y, Hit.Location.Z + GetCapsuleComponent()->GetScaledCapsuleHalfHeight());
|
||||
SetActorLocation(TeleportLocation, false, nullptr, ETeleportType::ResetPhysics);
|
||||
OnLedgeGrab();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,11 @@
|
||||
|
||||
class ALMPlayer;
|
||||
|
||||
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnSlideStartedSignature);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnSlideEndedSignature);
|
||||
|
||||
|
||||
// See https://www.youtube.com/playlist?list=PLXJlkahwiwPmeABEhjwIALvxRSZkzoQpk
|
||||
UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
|
||||
class LEGUMEMIX_API ULMMovementComponent : public UCharacterMovementComponent
|
||||
@ -71,6 +76,11 @@ public:
|
||||
UFUNCTION(BlueprintCallable, Category="Legumix|Slide")
|
||||
void CrouchToggle(bool Toggle);
|
||||
|
||||
UPROPERTY(BlueprintAssignable, Category=Legumix)
|
||||
FOnSlideStartedSignature OnSlideStarted;
|
||||
UPROPERTY(BlueprintAssignable, Category=Legumix)
|
||||
FOnSlideEndedSignature OnSlideEnded;
|
||||
|
||||
public:
|
||||
UPROPERTY(Transient)
|
||||
TObjectPtr<ALMPlayer> PlayerCharacterOwner;
|
||||
|
@ -111,6 +111,9 @@ public:
|
||||
UFUNCTION()
|
||||
void MovementChanged(ACharacter* Character, EMovementMode PrevMovementMode, uint8 PreviousCustomMode);
|
||||
|
||||
UFUNCTION(BlueprintImplementableEvent, Category=Legumix)
|
||||
void OnLedgeGrab();
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void DoLedgeGrabCheck();
|
||||
|
||||
|
Reference in New Issue
Block a user