Different Impact effects and sounds per material from projectile

Hi all,
been looking for any info on this but can’t seem to find any, so here goes.
How do we implement different impact effects and sounds per static mesh material like tree trunks, rocks etc. (btw I’ve seen fighters footsteps tut but this is a little different)
I have a projectile that has a particle and a sound playing when it hits the terrain and bsp which works just fine but not sure how to
change it for different mats.
What I have so far is surface types, dirt rock sand etc, corresponding physical mats which are referenced in the actual materials.
The BP for my projectile playing a particle and sound on general impact looks like this: This works on terrain and bsp.

And this is my attempt at playing different particles and sounds for different material types using the select node and get surface type. Doesn’t play the selected particle and sound though. (for the moment I’ve just got rock and dirt set up to trigger a blood particle and a assault rifle sound) But it’s playing the general particle and sound from the first screen shot. What am I doing wrong? :slight_smile:

sorry mods I meant to put this in ‘Blueprint Visual Scripting’

no problem, moved:)

You didn’t say what is going wrong, but right away it looks like you forgot to connect the get world location output into the + node below it.

Ahh yes, so on impact of a rock for example it’s not playing the effect and sound I have chosen in the select node. It’s playing the general effect and sound I have set up in the first screenshot. (sorry first screen was a duplicate of the second and has now been updated)
Thanks for noticing the unplugged node but it still isn’t working I’m afraid.

I would put some breakpoints on those nodes and see if the right things are getting called when you think they should.

Also I would randomly tweak the pitch & volume inputs on the play sounds a little bit to give it more variety once you figure out what’s wrong. Good luck!

I’m finding it difficult to debug the projectile as it gives me a list of the projectiles just fired not the one I’m about to fire in the debug filter, if that makes any sense.
debug.jpg

and yes of course, I’ll be using multiple sounds per cue with modulators etc for the hit sounds.

Got it, I think. I put the ‘projectile stop’ in place of the ‘BeginReceiveActorOverlap’ node. Or could probably use an EventHit.
Haven’t tried it on the terrain mats yet, hopefully it works just fine. (not sure why I’m getting two of the same image below)

For debugging, print out the material surface hit.

I’ve ran into some issues before with the object not reporting the surface I assigned. You could be hitting the collision capsule and pulling the surface type from there instead of the material. Depending on your setup you can assign surface types to collisions, bones, or materials.

That might help. =) Good luck!

P.S. When I said bones, I meant the PHAT physics collision capsule that might be assigned to a bone.

Thanks for the info Devero, I’ll give that a try.

And btw thanks for putting your awesome Impact particle effects on the marketplace. They’re excellent! :slight_smile:

Hey,

I’m attempting the same thing. The projectile is exploding on stop and playing the sound but I couldn’t get it to work on materials. (disregard audio asset names, testing only)

My programming is limited.

I tried a different event node at the start no difference. (also I’m not overly worried about the particles at this stage, just the audio)
Any help would be awesome!

this guy has a tutorial on making a projectile behave differently on different types of materials. has nothing to do with sound, but i think maybe you can get something out of it. its 5 part tutorial if you scroll through it you’ll find the part with setting up materials etc.

Thanks for the video, interesting stuff, but not really aligned with audio.

I ended up using the event "OnComponentHit (CollisionComponent) by right clicking on the collision component for the projectile.
seems to be working as intended. Thanks for the help and setup.

I think I need a way to reduce volume each time the ball (projectile bounces) or a alternative method, getting lots of sound spam when it rolls/collides to a stop