x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Multiple footstep sounds on landscape

After watching this Tutorial and reading through THIS I set up foot steps oon my character. Now I'm asking how would I set up footsteps on a landscape with mutible textures applied and painted around. I have leaves, dirt, ice, and grass in my landscape material.

Product Version: UE 4.10
Tags:
more ▼

asked Jan 25 '16 at 10:58 PM in Blueprint Scripting

avatar image

SoraJr
263 61 52 66

avatar image Dassoop Mar 23 '18 at 10:43 AM

Is there a way to do this and detect on an auto blending landscape layer. Maybe the most prominent material would be the one to define the surface type of that area?

avatar image SoraJr Mar 23 '18 at 07:38 PM

So you wanted to marge two different sounds together when the character steps on a blended material. I've never done that, but maybe that can be done through BP. I would give more information, but I'm not the best programmer. I just copy and paste what I see on YouTube. I'm replying to let you know I see your comment and I didn't wanna leave you line here.

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

We are doing this through Physical Material. It has to be set in Project Settings->Physics->PhysicalSurface and assigned to your materials.

I then fire a raycast straight below the actor to determine what's down there and fill FText CurrentSurface which contains name of the surface actor is currently on. When you get this text, it's just a question of a switch.

Btw. I am doing this in C++ for sake of speed but since this is Blueprints section, you can at least get some basic idea about what nodes to look for.

 void ATheForestCharacter::TracePhysicalSurface()
 {
     FVector StartTrace = FVector::ZeroVector;
     FVector CamLoc;
     FVector target;
     FCollisionQueryParams TraceParams;
     FHitResult currentHit;
 
 
     CamLoc = FirstPersonCameraComponent->GetComponentTransform().GetLocation();
 
     target = CamLoc + FVector(0.0f, 0.0f, -300.0f);
 
     TraceParams = FCollisionQueryParams(false);
     TraceParams.AddIgnoredActor(this);
 
     GetWorld()->LineTraceSingleByChannel(currentHit, CamLoc, target, ECollisionChannel::ECC_MAX, TraceParams);
     
     UPhysicalMaterial* physMat = NULL;
 
 
     if (currentHit.IsValidBlockingHit())
     {
 
 
         UPrimitiveComponent* comp = currentHit.GetComponent();
         if (comp)
         {
             UMaterialInterface*  mat = comp->GetMaterial(0);
             if (mat)
             {
                 physMat = mat->GetPhysicalMaterial();
             }
         }
 
 
         if (physMat)
         {
             const UEnum* EnumPtr = FindObject<UEnum>(ANY_PACKAGE, TEXT("EPhysicalSurface"), true);
             if (EnumPtr)
             {
                 CurrentSurface = EnumPtr->GetEnumText(physMat->SurfaceType);
             }
 
         }
     }
 }
more ▼

answered Jan 26 '16 at 12:08 AM

avatar image

metamorphium
107 7 13 23

avatar image SoraJr Jan 26 '16 at 12:16 AM

I've figured it out about 5 minutes after posting. I went into the layerinfo for the landscape material alt text

alt text I added the Physical Material there, and the sound blends nicely after tweaking it. Now when other people look at this, they'll have the C++ and the blueprint way. Thank you

1.png (40.2 kB)
2.png (26.7 kB)
(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question