Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 Dragon-Of-War · Aug 30, 2014 at 03:48 PM · audio

How do i make the audio louder?

 using UnityEngine;
 using System.Collections;
 
 public class CoreHealth : MonoBehaviour {
     public int MaxHealth;
     public TextMesh CoresGui;
     public int health;
     public CameraSetter set;
     public GameObject particle;
     public GameObject Cube;
     public GameObject Smoke;
     private bool hassmoke = false;
     public AudioClip play;
 
     void Awake(){
         health = MaxHealth;
     }
 
     public void ReceiveDamage(int damage){
         health -= damage;
         GameObject part = (GameObject)Instantiate (particle, Cube.transform.position, Cube.transform.rotation);
         AudioSource.PlayClipAtPoint (play,transform.position,10f); //audio
         Destroy (part, 1f);
     }
 
     void Update(){
         if(set.English == true)
             CoresGui.text = "Core Health: " + health + " / " + MaxHealth;
         else
             CoresGui.text = "Vida do Nucleo: " + health + " / " + MaxHealth;
 
         if (health <= 0)
             Application.LoadLevel (2);
         if (health == 30 && hassmoke == false) {
             Instantiate (Smoke, Cube.transform.position, Cube.transform.rotation);
             hassmoke = true;
         }
     }
 }
 

In this script, when an enemy hits the core, the core loses health, plays and particle and an audio clip. Everything works fine, but the audio is really low. I can't hear it. Can someone please help?

Comment
Add comment
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

3 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by no9rg · Sep 04, 2014 at 02:31 PM

At the line 22:

 AudioSource.PlayClipAtPoint (play,transform.position,10f); //audio


You don't make it any louder by setting the volume above 1f.

One of possible reasons is that all the other sounds play so loud that you can't hear what you want to hear. In that case you need to put them down by some value. But that's only my guessing.

Comment
Add comment · Share
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
4

Answer by chanfort · Nov 05, 2017 at 02:54 PM

You can also try to put the sound between the camera and the location of interest, e.g.

 AudioSource.PlayClipAtPoint (play, 0.9f*Camera.main.transform.position + 0.1f*transform.position ,10f);

In such case sound would play like it is 10 times closer to the camera.

Comment
Add comment · Show 2 · Share
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 Durium · Aug 12, 2020 at 02:04 PM 0
Share

Thank you, just what i was looking for! :)

avatar image abushaheen · Apr 29 at 09:01 PM 0
Share

you are amazing

avatar image
0

Answer by TRG96 · Aug 30, 2014 at 04:22 PM

Attach the audio source to the player or the camera and when "health -= damage;" you can play the damage clip that is attached to the camera.

Comment
Add comment · Show 4 · Share
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 Dragon-Of-War · Aug 30, 2014 at 04:34 PM 0
Share

Thanks for helping, but the sound is still low

avatar image screenname_taken · Aug 30, 2014 at 05:03 PM 0
Share

first check to see if the audio file itself is low or not. Then the volume in the editor.

avatar image Dragon-Of-War · Aug 30, 2014 at 06:14 PM 0
Share

I already checked that the audio source and the clip is in max volume. But still i can't hear much the sound in game

avatar image Klarax · Sep 04, 2014 at 02:19 PM 0
Share

check the distance of the gameobject with the audiosource on it from listener

try changing the sound to 2d sound and not 3d sound. 2d plays the max mo matter what distance is.

if all else fails. the sound is to low, and will need to boost it externally using sound edit software

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

6 People are following this question.

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

Related Questions

On touch play sound 1 Answer

Controlling audio clipping and distortion on multiple added sounds 1 Answer

ReverbZone output 1 Answer

play sound while at certain coordinates of map (javascript) 1 Answer

Playing a soundclip at random from an array. C# 2 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