Skip to content

Commit

Permalink
Merge pull request #219 from muchcharles/muchcharles-footstep-less-al…
Browse files Browse the repository at this point in the history
…locations-compile-fix

Revert footstep trace to kismet version
  • Loading branch information
dyanikoglu committed May 19, 2021
2 parents b467da3 + 0b1256a commit 06613da
Showing 1 changed file with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include "Components/AudioComponent.h"
#include "Engine/DataTable.h"
#include "Kismet/KismetSystemLibrary.h"
#include "Library/ALSCharacterStructLibrary.h"
#include "PhysicalMaterials/PhysicalMaterial.h"
#include "NiagaraSystem.h"
Expand Down Expand Up @@ -46,25 +47,8 @@ void UALSAnimNotifyFootstep::Notify(USkeletalMeshComponent* MeshComp, UAnimSeque

FHitResult Hit;

ECollisionChannel CollisionChannel = UEngineTypes::ConvertToCollisionChannel(TraceChannel);

FCollisionQueryParams Params(SCENE_QUERY_STAT(ALSFootstep), true /*bTraceComplex*/, MeshOwner);
Params.bReturnPhysicalMaterial = true;
for (auto& Child : MeshOwner->Children)
{
Params.AddIgnoredActor(Child);
}

bool const bHit = MeshComp->GetWorld() ? World->LineTraceSingleByChannel(Hit, FootLocation, TraceEnd, CollisionChannel, Params) : false;

#if ENABLE_DRAW_DEBUG
if (MeshComp->GetWorld())
{
DrawDebugLineTraceSingle(MeshComp->GetWorld(), FootLocation, TraceEnd, DrawDebugType, bHit, Hit, TraceColor, TraceHitColor, DrawTime);
}
#endif

if (bHit)
if (UKismetSystemLibrary::LineTraceSingle(MeshOwner /*used by bIgnoreSelf*/, FootLocation, TraceEnd, TraceChannel, true /*bTraceComplex*/, MeshOwner->Children,
DrawDebugType, Hit, true /*bIgnoreSelf*/))
{
if (!Hit.PhysMaterial.Get())
{
Expand Down

0 comments on commit 06613da

Please sign in to comment.