more than 1 audio source on an object? how to play specific one via script?

Hey I have two audio source components: punch hit audio, and a walking audio.

I have a movement script and I want to insert a specific audio variable for the walking audio:

** public AudioSource aSourceWalking;

void Start () {
    aSourceWalking = 
}

void Update() {
    if (Input.GetKey("w"))
    {
        transform.Translate((Vector3.forward) * moveSpeed * Time.deltaTime);
        aSourceWalking.Play();

    }

Anybody? shiet…

Declare two AudioSource variables and assign both of them in the inspector:

public AudioSource aSourceWalking;
public AudioSource aSourcePunching;

If you can’t assign them in the inspector because your object is instantiated at runtime, you can instantiate the AudioSource components at runtime too.

ok cool thanks I’ll try it now