Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 issac1235 · Jun 13, 2019 at 02:20 AM · audiosound effectsdistortion

About sound distortion

Hi! I added walking sound effect to my character and in play mode, the sound is distorted when my character is walking. Does anybody know how to fix it? I have already turned Doppler Factor and Doppler Level to 0 but it didnt work.

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
 public class movingcharacterscript : MonoBehaviour
 {
     public float speed = 0f;
     public float rotspeed=80;
     public float rot = 0f;
     Vector3 movDir = Vector3.zero;
     float gravity = 20.0f;
     
     CharacterController controller;
     Animator anim;
     AudioSource m_AudioSource;
     bool AnimPa;
 
     public AudioClip impact;
 
     // Start is called before the first frame update
     void Start()
     {
          m_AudioSource = GetComponent<AudioSource>();
         controller = GetComponent<CharacterController>();
         anim = GetComponent<Animator>();
       
            }
 
     // Update is called once per frame
     void Update()
     {
        
         if (Input.GetKey(KeyCode.W))
         {
             anim.SetBool("AnimPa",true);
             movDir = new Vector3(0, 0, 1);
             movDir *= speed;
             movDir = transform.TransformDirection(movDir);
             m_AudioSource.PlayOneShot(impact, 0.5f);
         }
        
         else
         {
             anim.SetBool("AnimPa",false);
             movDir = new Vector3(0, 0, 0);
             m_AudioSource.Stop();
 
         }
     
        
            
          
       
         rot += Input.GetAxis("Horizontal") * rotspeed * Time.deltaTime;
         transform.eulerAngles = new Vector3(0, rot, 0);
 
         movDir.y -= gravity * Time.deltaTime;
     }
        
      
     }
 
 

alt text

@ernest326648 I tried use playoneshot but this time no sound at all.

screenshot-8.png (63.9 kB)
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 Meishin · Jun 13, 2019 at 06:43 AM 0
Share

Hello Issac1235, Hard to tell from your description, did you check the following :

  • The Audio Source playing your walking sound is on the same object as your Audio Listener ?

  • The Audio Source "$$anonymous$$ch" is set to 1 ?

  • The Audio Source output is not set to an Audio$$anonymous$$ixer (or that Audio$$anonymous$$ixer doesn't apply any effect) or you set "Bypass Effects" & "Bypass Listener Effect" to true on your audio source ?

There are still a lot of possibilities but those must be the more common ... if you can post a screen or your audio listener & your triggering sound code we might be able to understand what's happening with you

avatar image issac1235 Meishin · Jun 13, 2019 at 01:51 PM 0
Share

Hi $$anonymous$$eishin, I attached my code. Could you please help me see what went wrong?

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

107 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 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 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 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 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 avatar image avatar image

Related Questions

One Slider Control More Than One Sound 1 Answer

Can't play multiple sounds at once 2 Answers

Sound effect issues 1 Answer

Best way to do 3D audio for lots of gameobjects 0 Answers

Can't get Sound working but music is fine 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