diff --git a/unity_Project/Assets/Scripts/PlayerSounds.cs b/unity_Project/Assets/Scripts/PlayerSounds.cs index 3c3a142..9f1a3e0 100644 --- a/unity_Project/Assets/Scripts/PlayerSounds.cs +++ b/unity_Project/Assets/Scripts/PlayerSounds.cs @@ -47,19 +47,20 @@ public class PlayerSounds : MonoBehaviour { // > Needs proper logic // > Purpose of this function is to determine whether the player object is // standing on the terrain object that has been tagged with "sand". - void CheckGround(ControllerColliderHit FootHit){ + void CheckGround(){ //playerCollider = PlayerObject.GetComponent; - if (FootHit.gameObject.tag == "sand") { - FootOnSand = true; - } - + RaycastHit FootHit; + + Ray ray = new Ray(transform.position, -Vector3.up); - else { + if (Physics.Raycast (ray, out FootHit, 1.3f)) { + if (FootHit.transform.tag == "sand") + FootOnSand = true; + }else{ FootOnSand = false; } - } @@ -67,6 +68,7 @@ public class PlayerSounds : MonoBehaviour { void PlayFootstep(){ float volRandom = Random.Range (volLowRange, volHighRange); + CheckGround (); // SAND FOOTSTEP SOUND diff --git a/unity_Project/Assets/Textures.meta b/unity_Project/Assets/Textures.meta deleted file mode 100644 index 8915b1d..0000000 --- a/unity_Project/Assets/Textures.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 97def69cc8aa8f0458d67929f23873dd -folderAsset: yes -timeCreated: 1444371283 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: