- Home /
The question is answered, right answer was accepted
Walking audio needed
Hello! Thanks for helping :)
currently in my game (Alot like slender, but better) i have it basically complete. Paper, Slender,everything!
but im missing one thing and thats the walking audio.
I have a script built to play the audio the only problem is, It plays it at a time. so my audio has to only be one step for it to work.
I cant find ANY of these online, and i really need some help.
The games based in a grassy/woodlands enviroment.
Someone, Please! Help!
Thanks!
-Prophet968
Answer by AlucardJay · Nov 07, 2012 at 01:27 PM
I wrote an answer here for swapping between walking and running footsteps (no sound when not moving) : http://answers.unity3d.com/questions/343383/switch-between-two-different-sounds-for-walking-an.html
Edit : Here's a version just for walking and stopped :
#pragma strict
var walk : AudioClip;
var isWalking : boolean = false;
function Start()
{
audio.Stop();
audio.clip = walk;
}
function Update()
{
GetState();
PlayAudio();
}
function GetState()
{
if ( Input.GetAxis( "Horizontal" ) || Input.GetAxis( "Vertical" ) )
{
// Walking
isWalking = true;
}
else
{
// Stopped
isWalking = false;
}
}
function PlayAudio()
{
if ( isWalking )
{
if ( !audio.isPlaying )
{
audio.Play();
}
}
else
{
audio.Stop();
}
}
Answer by goldkillerv · Nov 07, 2012 at 12:52 PM
Here's the link to a fast walk audio: Fast-Walk
Tell us in detail of what you want such as a walk in some kind of room or walk outside on stones? etc..
Answer by angrycarrots · Feb 22, 2013 at 03:52 AM
Wait, here is the easiest script in the history of man kind. Make sure that you attach this script to an object that has an audio source:
using UnityEngine;
using System.Collections;
public class Running : MonoBehaviour {
void Start () {
}
void Update () {
if(Input.GetKey("w")){
if(!audio.isPlaying)
audio.Play();
}
if(Input.GetKeyUp("w"))
audio.Stop();
}
}
AND $$anonymous$$A$$anonymous$$E SURE YOU HAVE THE RUNNING AUDIOCLIP IN THE AUDIO SOURCE OBJECT :D
Answer by SFX-AND-MUSIC-FOR-GAMES · Jun 24, 2014 at 04:39 PM
If you need actual walking footstep sounds I'm selling a pack of over 100 footsteps on various surfaces for only $5.00. Let me know if you need any sound effects or music for projects. Thanks, Adam adam@craftmediagroup.com
This really isn't the place for advertising your product, but it is relevant to this thread (even if the thread is old and inactive). I've given you the benefit of the doubt ;)
Follow this Question
Related Questions
Sound not working? 1 Answer
audio.Play ignoring WaitForSeconds 2 Answers
Randomly play audio 0 Answers
Change the Audio SampleRate 0 Answers
Audio doesn't play 1 Answer