Open an animation sequence or skeleton to add footstep notifies, and open the Animation Data Modifiers window.
Add AutoFootstepAnimationModifier
in the window and set its properties.
Settings to play Niagara and sound effect by surface type (Click to open)
-
Define surface types in the project settings.
-
Create a data asset of
AutoFootstepEffectContext
. -
Open the data asset and press the Add All Surface Type Elements button, then set
Niagara
andSound
for each surface type. -
Create physical materials for each surface type.
-
Set the physical material to a mesh or material, such as a floor, where you want to change the footstep effect.
-
Go back to the modifiers window, set
AutoFootstepAnimNotify
toNotify Class
and the data asset toEffect Context
inNotify Params
.
Apply AutoFootstepAnimationModifier
in the window, then footstep notifies will be added automatically.
Create a child class of AutoFootstepAnimationModifier
and override On Notify Added
, then apply it to the animations.
Create a child class of AutoFootstepAnimNotify
and override On Trace Hit
, then add it to the animations.
You can use Play Effect by Surface Type
of AutoFootstepEffectContext
.
If you have a naming convention in the folders or animations, you can use Path Filters
in the modifier to filter the animations to apply it.
You can set Draw Debug Line
in the modifier to true to see if it works.
Please try to increase the value of Ground Height Range
in the modifier.
Please try to increase the value of Grounded Threshold
in the modifier.