• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Mar 07, 2015 at 10:05 PM by KnightRiderGuy for the following reason:

Turned out the Audio Clip was set as a 3d sound when it should have Not Been set to 3d sound.

avatar image
0
Question by KnightRiderGuy · Feb 11, 2015 at 08:06 PM · audioaudiosourceaudioclipaudioplayaudio.playoneshot

2nd Audio Clip Not Playing

My Debug line is working so I know it's reaching that pint but for some reason the audio clip does not play? Here is my code:

 using UnityEngine;
 using System.Collections;
 
 public class MicroJamSwirlManagerScript : MonoBehaviour {
 
     // Sound FX Array
     public AudioClip MicroJamSwirlFX;
     public AudioClip KITTVoice01;
     public AudioClip KITTVoice02;
     //Assign Animation Controller
     public Animator MicroJamSwirlAni;
 
 
 
 
     void Start (){
         //initializes micro Jam Sound FX
         audio.clip = MicroJamSwirlFX;
         audio.loop = true;
         //audio.Play();
 
         audio.PlayOneShot(KITTVoice01);
 
         //Start Animation Delay
         StartCoroutine(Wait());
         StartCoroutine(Wait02());
 
         StartCoroutine(LoadAfterDelay2("KnightSpinningLogo_NoKITTintro"));
         //initialize Micro Jam Animation Loop
 
         //MicroJamSwirlAni.SetBool("MicroJamSwirlOff", !MicroJamSwirlAni.GetBool("MicroJamSwirlOff") );
     }
 
     public  IEnumerator Wait(){
         yield return new WaitForSeconds(1.5f);
         MicroJamSwirlAni.SetBool("MicroJamSwirlOff", !MicroJamSwirlAni.GetBool("MicroJamSwirlOff") );
         audio.Play();
     }
 
     public  IEnumerator Wait02(){
         yield return new WaitForSeconds(2.1f);
         audio.PlayOneShot(KITTVoice02);
         Debug.Log("exicuted This Line");
     }
 
     IEnumerator LoadAfterDelay2(string levelName){
         yield return new WaitForSeconds(5.5f); // wait 1 seconds
         Application.LoadLevel(levelName);
         
     }
 }
Comment
Add comment · Show 11
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image giulio-pierucci · Feb 11, 2015 at 08:10 PM 0
Share

I don't remember if the clip that you want play must be in audio.clip field or in audio.clips array.

$$anonymous$$aybe i wrong...

avatar image KnightRiderGuy · Feb 11, 2015 at 08:14 PM 0
Share

Yeh it's confusing, the sour effect plays and loops as it should, the first voice clip plays but the one above the Debug.log does not play? Can't figure out why.

avatar image giulio-pierucci · Feb 11, 2015 at 08:19 PM 0
Share

maybe that audiosource component can play only one clip at time?

avatar image KnightRiderGuy · Feb 11, 2015 at 08:24 PM 0
Share

Well the audio source is playing the other two sounds from the array just fine, so I'm not sure it's that.?

avatar image KnightRiderGuy · Feb 11, 2015 at 09:14 PM 2
Share

Sunofa....!! turns out I had the audio clip as a 3D sound when that should have been set to off.... Dang!! Solved!

Show more comments

0 Replies

  • Sort: 

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How can I play audio clips depending on the players movement 0 Answers

Stop audio from looping and play at lower volume 1 Answer

How to Switch The Audio Clip using button 0 Answers

Looping an audio while holding "shift key" 1 Answer

Problems combining Audio triggers, PlayOneShot and Audio Arrays 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges