Collider coll; public PhysicMaterial grass;public PlayerSoundSys sounds; void Start() { coll = GetComponent<Collider>(); } private void OnCollisionStay(Collision collision) { if(coll.sharedMaterial == grass) { sounds.FootStepSoundPlayGrass(); } }