Play different sound while walking on different materials

I want the game to play a different sound when the character walks on water or grass
this is my script

using UnityEngine;
using System.Collections;

public class SuonoAcqua : MonoBehaviour {

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}

public AudioClip WaterSplash_Long;
private AudioSource WaterSplash_LongAudioSource;

void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == “Water”)
{
//AudioSource audio =GetComponent (WaterSplash_Long);
WaterSplash_LongAudioSource.clip=WaterSplash_Long;
WaterSplash_LongAudioSource.Play ();
}
}
}

but it doesn’t work at all.
How can i play a sound when the character collides with the water? (i added a mesh collider to the water but still doesn’ work)
pls help

If it’s a 3D game, then try putting triggers on the character’s feet instead of using the whole character for this check.

For both 3D and 2D, you can check the animation frame using AnimatorStateInfo.normalizedTime (you can get the AnimatorStateInfo by using Animator.GetCurrentAnimatorStateInfo()) and play the sound when the frame matches any of the ones where the character’s foot hits the ground. You’ll still have to get the terrain type by checking its tag or by making a TerrainType class or something to know which sound set to play from.