The audio doesn’t play when I press the spacebar, but when I let off it plays. I’ve looked it over but I can find any errors.
void ProcessThrust()
{
if (Input.GetKey(KeyCode.Space))
{
rb.AddRelativeForce(Vector3.up * mainThrust * Time.deltaTime);
if(!audioSource.isPlaying)
{
audioSource.Play();
}
else
{
audioSource.Stop();
}
}
}