using UnityEngine;
using System.Collections;
public class Footsteps : MonoBehaviour {
public AudioClip[] footsteps;
public float nextFoot;
IEnumerator Start ()
{CharacterController controller = GetComponent ();
while (true) {
if(controller.isGrounded && controller.velocity.magnitude > 0.3F)
{
audio.PlayOneShot(Footsteps[Random.Range(0, Footsteps.Length)]);
yield return new WaitForSeconds(nextFoot);
}
else
{
yield return 0;
}
any help would be appreciated.
I am trying to get a footsteps script, but I have been having no luck I keep getting this error.
Assests/Footsteps.cs(17.51): error CS0119: expression denotes a 'type', where a 'variable','value', or 'method group' was expected
Not quit sure what to do I am a beginner at Unity.
↧