Skip to content
Draft
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
7 changes: 5 additions & 2 deletions Source/ALS/Private/Notifies/AlsAnimNotify_FootstepEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void UAlsAnimNotify_FootstepEffects::Notify(USkeletalMeshComponent* Mesh, UAnimS

if (bSpawnSound)
{
SpawnSound(Mesh, EffectSettings->Sound, FootstepLocation, FootstepRotation);
SpawnSound(Character, Mesh, EffectSettings->Sound, FootstepLocation, FootstepRotation);
}

if (bSpawnDecal)
Expand All @@ -185,7 +185,7 @@ void UAlsAnimNotify_FootstepEffects::Notify(USkeletalMeshComponent* Mesh, UAnimS
}
}

void UAlsAnimNotify_FootstepEffects::SpawnSound(USkeletalMeshComponent* Mesh, const FAlsFootstepSoundSettings& SoundSettings,
void UAlsAnimNotify_FootstepEffects::SpawnSound(const AAlsCharacter* Character, USkeletalMeshComponent* Mesh, const FAlsFootstepSoundSettings& SoundSettings,
const FVector& FootstepLocation, const FQuat& FootstepRotation) const
{
auto VolumeMultiplier{SoundVolumeMultiplier};
Expand Down Expand Up @@ -216,6 +216,9 @@ void UAlsAnimNotify_FootstepEffects::SpawnSound(USkeletalMeshComponent* Mesh, co
Audio = UGameplayStatics::SpawnSoundAtLocation(World, SoundSettings.Sound.Get(), FootstepLocation,
FootstepRotation.Rotator(),
VolumeMultiplier, SoundPitchMultiplier);

const_cast<AAlsCharacter*>(Character)->SpawnFootstepSound(VolumeMultiplier, SoundPitchMultiplier);

}
}
else if (SoundSettings.SpawnMode == EAlsFootstepSoundSpawnMode::SpawnAttachedToFootBone)
Expand Down
5 changes: 5 additions & 0 deletions Source/ALS/Public/AlsCharacter.h
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,11 @@ class ALS_API AAlsCharacter : public ACharacter

void ConstraintRagdollSpeed() const;

// Footsteps

public:
UFUNCTION(BlueprintImplementableEvent, Category = "Als Character")
void SpawnFootstepSound(const float VolumeMultiplier, const float PitchMultiplier);
// Debug

public:
Expand Down
2 changes: 1 addition & 1 deletion Source/ALS/Public/Notifies/AlsAnimNotify_FootstepEffects.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ class ALS_API UAlsAnimNotify_FootstepEffects : public UAnimNotify
const FAnimNotifyEventReference& NotifyEventReference) override;

private:
void SpawnSound(USkeletalMeshComponent* Mesh, const FAlsFootstepSoundSettings& SoundSettings,
void SpawnSound(const AAlsCharacter* Character, USkeletalMeshComponent* Mesh, const FAlsFootstepSoundSettings& SoundSettings,
const FVector& FootstepLocation, const FQuat& FootstepRotation) const;

void SpawnDecal(USkeletalMeshComponent* Mesh, const FAlsFootstepDecalSettings& DecalSettings,
Expand Down