Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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 /
avatar image
0
Question by chibisnowflake · Dec 10, 2013 at 04:45 AM · audiomusicoverlappingaudio.playoneshot

Wanting SFX to overlap background Audio (overlapping Audio)

I'm unsure how to fix this one. I've looked up many other forums on overlapping audio help and I'm unsure what to do.

In my game I have some background music for the level but also when my lasergun shoots the audio for the laser cuts the music and half and the background Audio stops playing.

I've tried putting the laser sound at 1 priority and the background music on full priority. I've dabbled with the 2D/3D sounds (though I'm unsure what that does), and I don't know how it's possible to just have both sounds playing at the same time.

The Audio listener is attached to the main camera (it's a first person shooter), the gun holds the laser sound and the first person player holds the gamelevelmusic sound.

They're both audio.PlayOneShot(musichere); and the background music plays in the start function in the first person shooter while the laser sound is played after the "fire" function in the shoot script. (It's extremely simple scripts I don't think it's worth it to post it here)

Comment
Add comment · Show 2
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 Tomer-Barkan · Dec 10, 2013 at 10:06 AM 0
Share

Are you using two separate audiosources?

avatar image Bhuvi · Dec 10, 2013 at 10:43 AM 0
Share

Try attaching another audio source to your main camera, and add the audio to it. 1. Uncheck Playonawake 2. Uncheck Loop add the audiosource to your script and audio.Play().Better don't call this line in Update. If you are placing this line in Update. use a flag variable and break the loop once it is called.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

18 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

Related Questions

How to STOP music when loading a SPECIFIC SCENE? 3 Answers

Why is my backtrack's volume getting lower? 0 Answers

Getting beats from a song using frequency range 1 Answer

Music Zones play music with tags? 0 Answers

AudioSource.Pause not working? 3 Answers


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