hey.. i am doing a little game and i am a 3d artist not a programmer 
all i need is 2 sounds
-
wen the door animation starts
-
wen i walk
-
i have a script that open the door with animation wen the player is close to it:
using UnityEngine;
using System.Collections;
public class Door : MonoBehaviour {
public float check;
private Animation anim;
private Vector3 pos;
void Start () {
anim=animation;
pos=transform.position;
}
void Update () {
float dist=Vector3.Distance(pos,EpicCitadelControl.t.position);
anim["Door_02"].normalizedTime = 1-dist*check;
}
}
- i use the Epic Citadel Control for the movement and i what that wen ever i move the sound will get played
the script:
http://wiki.unity3d.com/index.php/Tap_to_Move_Drag_to_Look_iPhone
on both objects i put Audio Source with the sound i want them to play
tnx for anyone that can Help me 
Look at the AudioSource class.
like i sad i am not a programmer i donât know that to do 
Look at AudioSource
public AudioClip thisSound;/// make this variable public, so you can assign it in the editor.
void Start()
{
audio.clip = thisSound;
audio.Play();
}

If you want to assign a clip, itâll be AudioClip, not AudioSource. An AudioSource is a component attached to a game object in order to play a sound (which you can simply call this.audio to call the AudioSource attached to the game object that the script is attached to).
In the OP case, heâd probably want to have a boolean to play the AudioSource for the door so heâll only call play once. As youâve already got your open door code, youâll just need to set a boolean to be true then play the sound only when it is true. Set it false after that.
Yes, I already edited it.
That code is safe. It is late. And I have not touched audio for a while. Hopefully that helps.
ok⌠so where supposed to put the script ?
i need to tell him where to start playing the audio ?
in the âEpic Citadel Controlâ script where do i have a comend that says now i player is moving that i can put the âaudio.Play();â ?
same with the door ?
Sorry for the ignorance
Please help me, Iâm desperate
As youâve already got the result for your distance check, youâll probably want to start from there. So check if your distance is close enough for your door to be triggered to open. If it is close enough, play the sound. Please donât just copy straight out.
if(dist < distanceToOpenDoor)
{
if(!audio.isPlaying) // Keeps playing the audio if it is not playing
{
audio.Play();
}
// OR
if(!hasAudioPlayed) // Plays audio once until you reset it
{
audio.Play();
hasAudioPlayed = true;
}
}
The above code shows 2 possible way to go about doing your audio, depending on your needs.
As for your player, youâll need to check if your player is moving then check if the audio is playing. If the player is moving but the audio is not playing currently, youâll want to play the audio.
Iâd recommend you to read up some basic scripting tutorial. Saying youâre just an artist and not a programmer isnât a good excuse to skip out on some basic scripting knowledge.