My audio no longer plays in the player?
Hey guys, need some help here. I'm new to unity. I'm creating a game based on rocket ships and have attached an audio file to my rocket ship. Even wrote the code to make it play when I press a particular button.
Up until yesterday, it seemed to work just fine, but for some reason, today the audio no longer plays when I play the game. I have read articles and watched videos but none seemed to help.
Here is my code for the audio:
public AudioSource audioSource;
public void Thrust()
{
float rotationThisFrame = rcsThrust * Time.deltaTime;
if (Input.GetKey(KeyCode.W))
{
rigidBody.AddRelativeForce(Vector3.up * rotationThisFrame);
if (!audioSource.isPlaying) //So it doesn't layer
audioSource.Play();
}
else
audioSource.Stop();
}
}
Your answer
Follow this Question
Related Questions
Footstep sound does not finish playing, it keeps restarting on movement 0 Answers
There is a problem with my script... 0 Answers
Multiple Video Player and audio player on the same scene 0 Answers
Oculus Rift - Audio only in ear, not positional 0 Answers
Trigger detects player collision and play specific audio from array 1 Answer