I was wondering how to make it so that when up arrow is pressed one sound will play but when you let go of the up arrow another sound plays. I tried the script but it didnt work.
Thanks!
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayonW : MonoBehaviour
{
public AudioSource someSound;
public AudioSource someSound2;
// Use this for initialization
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.UpArrow))
{
if (!someSound.isPlaying)
{
someSound.Play();
}
}
if (Input.GetKeyUp(KeyCode.UpArrow))
{
someSound2.Play();
}
}