|
|
@ -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<CapsuleCollider>;
|
|
|
|
|
|
|
|
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
|
|
|
|