Hi, I am having trouble with the basics of a horror game.
I am trying to make a game similar to slender (Yes, I know another slender question)
I already have the map and the player (the player has a flashlight)
I also have a background cricket noise.
What I need is where I can get a good free footstep sound effect and a script to play it (I dont need different sounds for different floors just a basic footstep script. And it would also help me a lot if you gave me a website to get free 3d models.
THANKS!
duuuude, you are asking alot! But am in a good mood, so :
Footstep sound effects - From memory there are footstep sounds in the bootcamp or angrybots, just check the assets in unity tutorials or google footstep sound : LMGTFY - Let Me Google That For You : Download Free Sound Effects : http://www.grsites.com/archive/sounds/
Script for footsteps - I just wrote an answer for someone here : Switch between two different sounds for walking and sprinting? - Questions & Answers - Unity Discussions
and just walking and stopped here : Walking audio needed - Questions & Answers - Unity Discussions
3D Models : http://thefree3dmodels.com/
Happy Days =]
EDIT : Here is a footstep script :
#pragma strict
public var walk : AudioClip;
var walkAudioSpeed : float = 0.4;
private var isWalking : boolean = false;
private var walkAudioTimer : float = 0.0;
function Start()
{
audio.Stop();
audio.clip = walk;
}
function Update()
{
PlayFootsteps();
}
function PlayFootsteps()
{
// check for movement inputs here
if ( Input.GetAxis( "Horizontal" ) || Input.GetAxis( "Vertical" ) )
{
// Walking
isWalking = true;
}
else
{
// Stopped
isWalking = false;
}
// play audio here
if ( isWalking )
{
//if ( !audio.isPlaying )
if ( walkAudioTimer > walkAudioSpeed )
{
audio.Stop();
audio.Play();
walkAudioTimer = 0.0;
}
else
{
audio.Stop();
}
}
}
Now, this is how it works :
if Input.GetAxis( “Horizontal” ) or ( “Vertical” ), so it is checking for any input from the horizontal and vertical axis (WASD and arrow keys by default). If you are using other inputs and not GetAxis, then you need to change that part
e.g.
// check for movement inputs here
//if ( Input.GetAxis( "Horizontal" ) || Input.GetAxis( "Vertical" ) )
if ( Input.GetKey( KeyCode.W ) || Input.GetKey( KeyCode.A ) || Input.GetKey( KeyCode.S ) || Input.GetKey( KeyCode.D ) )
{
// Walking
isWalking = true;
}
else
{
// Stopped
isWalking = false;
}
See how you go with that =]
Thanks jay! I hope it all works