This is part of the code Im using from Alucard Jay.Sorry because im still new to unity..and just started about a week ago.
function PlayFootsteps()
{
// Play Audio
if ( isWalking )
{
if ( walkAudioTimer > walkAudioSpeed )
{
audio.Stop();
audio.clip = walkSounds[ Random.Range( 0, walkSounds.Length ) ];
audio.Play();
walkAudioTimer = 0.0;
}
}
else if ( isRunning )
{
if ( runAudioTimer > runAudioSpeed )
{
audio.Stop();
audio.clip = runSounds[ Random.Range( 0, runSounds.Length ) ];
audio.Play();
runAudioTimer = 0.0;
}
}
else
{
audio.Stop();
}
So my question is..I cant just change this code
audio.clip = walkSounds[ Random.Range( 0, walkSounds.Length ) ];
to
audio.clip = walkSounds; right? I tried and i got compile errors.
Any help?
↧