Animation Notifies - Different Sounds
I have the ThirdPersonRun animation that I have added some notifies to...Works great. What I was hoping though is to use those notifies with some logic...for example, rather than simply playing the same sound I would like to play snow sound when the material the character is walking on is snow. Is that possible with Persona notifies? When I open up the created BP for the notify could I simply modify that to my liking? Or, bad practice? Thanks!
asked Sep 27 '15 at 05:31 PM in Everything Else
Ah, coincidentally, I just figured out how to do this the other day... here's what you do:
Create a new, custom anim notify event. Place them onto the timeline when the foot impacts with the ground. Go into your anim blueprint and create an event to respond to the anim notify event.
Within the anim notify event, you want to shoot a line trace from the character position down to the ground. This should generate a 'hit result' structure. Within the hit result structure, you get a 'hit physical material' option. I created a bunch of if statements which play different sound cues based on the physical material you're standing on (dirt, snow, wood, stone, metal, etc). Each sound cue randomly selects a few different footstep sounds and varies the pitch slightly. So, stepping on snow has 3 different snow stepping sounds, and of those, I pick on at random and randomize the pitch slightly.
The last part you have to do is actually go through and create a physical material for every type of surface you want to work with. Snow, metal, dirt, wood, stone, gravel, etc. Once you've created the physical materials, go into the material editor for the corresponding materials (ie, M_Snow). Select the main material node and then look for a drop down which says "Phyiscal Material" and select the corresponding physical material (ie, PM_Snow).
Now, when a player walks over the material, the animation blueprint will fire an event which polls the surface they're walking on and play a corresponding sound cue. If a material doesn't have a physical material associated with it, no sound will play (unless you want to create a default case).
answered Sep 27 '15 at 07:02 PM
You could also add a notifier that is a 'Sound Cue' and within that sound cue blueprint you use a random/modulation node so that any time it's triggered it's varied.
answered Mar 16 '16 at 03:46 PM
Sry to Necro, but how can i get my Characters Location in the Anim BP, it is not a pawn but an NPC im doing this for
answered Sep 25 '18 at 09:01 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here