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