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 Cosmology27 · Jul 31, 2019 at 04:30 AM · buttonsound

SFX seem slow

So I have a button on click playing a sound effect. I've gone into the sound effect and edited it manually, so there's absolutely no dead air at the beginning of the sound. The sound is literally 0.16 of a second. It's a deep button press type sound, just to give my buttons more of a "buttonly" feel when being pushed. Again, I've edited out the dead air on the sound, so it should start immediately upon being pressed.

When I push the button, there's a slight delay. It's not a lot, but it's enough to make it feel like a delay when pushing the button. It's not a satisfying click of a button, if you know what I mean. I've played games from Unity where button pushes feel good, so I'm just wondering if there's a trick to making the sound effect play faster, because clearly there is something causing a delay here.

Thanks for any help you can provide! Let me know if there's more info I can give.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · Jul 31, 2019 at 08:23 AM

There are essentially two factors:

  • If you use an ordinary button click event it will fire when a click happens. A click is a mouse down and mouse up event. So the code runs when the user releases the mouse / touch. You want to use the "IPointerDownHandler". Unfortunately Unity seems to have removed all the UI stuff from their documentation.

  • The second issue can be an actual delay in your sound file. If that's the case you have to edit your sound effect and trim the silent part at the beginning.

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
0

Answer by Cosmology27 · Aug 02, 2019 at 02:38 AM

Is there any way to have the IPointerDownHandler happen in the inspector? Or do I have to write all my own mouse clicks manually now?

EDIT: I'm trying to get the mouse down to work, but I can't figure out how to get IPointerDownHandler working. Online it seems a lot of people have strange issues with it. I'm trying to put it on a button, and can't seem to find a solution.

I've tried using "public void OnMouseDown()", and I'm getting zero errors, but it's not recognizing the mouse down. It looks to me like it should work (all I'm doing is trying to get a debug message to see if it works, it's super simple). I'm guessing the onmousedown isn't meant for buttons, and I can't figure out the IPointerDownHandler. How should I do it? Thanks for the help!

Comment
Add comment · Show 1 · 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 Cosmology27 · Aug 08, 2019 at 07:01 PM 0
Share

Still looking for an answer to this. That IPointerDownHandler isn't doing anything, but it's also not giving me an error. Still can't manage to get a mouse down to work on a button. Thanks for any help anyone can provide.

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

132 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 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

UI Button deletes Function on start 1 Answer

Sound play on key combinations? 1 Answer

How to play a sound effect 1 Answer

Button OnClick() after Scene restart is Missing (Object) 2 Answers

Separate setting music volume and sfx in one scene 0 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