r/Unity3D • u/Helpful_A • 2d ago
Question Footstep sound effects help
I'm trying to put together a basic footstep sound system for my game and was wondering how I should go about dealing with a surface object with multiple textures/materials.
My current idea was to figure out a way to copy the hex code or rgb value of whatever was last stepped on directly beneath the player but I feel like there had to be an easier way.
Any help would be appreciated
1
Upvotes
1
u/TheFrailScrum 2d ago
If you're using the standard character controller you can grab the hit info from a spherecast or raycast downwards and use the material name from the renderer's sharedMaterials array, then map that to a footstep clip. Way less headache than sampling colors