How to retrieve the terrain's texture's name at a defined position.

Hello,

I’m working on an advanced reusable footsteps system.
At the moment I’m locked on how to get the texture name of the current terrain at a defined position.

  1. Raycast on terrain : Done.
  2. Retrieve the texture at this collision point : To do.
  3. In function of the name of this texture play a random song : Done.

If you have any idea how to do it, it will be great.
I tried to find my answer by browsing the “Terrain”, “TerainData” components and “SplatPrototype”, “DetailPrototyp” class documentation but I didn’t find any relevant information to fix my problem.

Thank you for your time.

I already checked this link but this don’t show how to get the texture with a texture index.