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 GiuseppeB · Apr 13, 2012 at 09:46 AM · collisionmeshsoundcube

Dice roll collision sound

hey guys, i'm trying to reproduce the sound effect of a rolling dice, but i can't really figure out how to do that. I tryied with a simple oncollision function on a cube mesh, but the result was far from what I need.

Comment
Add comment · Show 3
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 fafase · Apr 13, 2012 at 09:47 AM 1
Share

You need to post your code please. So that we can tell you where you are wrong.

avatar image flamy · Apr 13, 2012 at 09:49 AM 0
Share

doing it with colliders "may" work if you cube has various colliders around it. one collider is not goin to give the effect unless you just fake it!

avatar image GiuseppeB · Apr 13, 2012 at 09:55 AM 0
Share

I have no code to post I'm sorry! so if not using colliders, what should I use? thanks for the answers

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by gregzo · Apr 13, 2012 at 10:10 AM

Fake like a true conArtist!

 var myDiceRolls:AudioClip[]; //assign a few different roll sounds here, in ascending length(shorter to longer clips, for example)
 
 OnCollisionEnter(collision : Collision)
 {
    if(audio.isPlaying==false)
    {
         var soundIndex : int = collision.relativeVelocity.magnitude; //this will round the magnitude. Will need tweaking.
         audio.clip=myDiceRolls[soundIndex];
         audio.Play();
    }   
 }
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 gregzo · Apr 13, 2012 at 09:52 AM 0
Share

Easy answer: Fake it using pre-recorded dice rolls.

$$anonymous$$ore difficult : A mix of "dice hits" and "rolls": trigger the hits if the collision's relative magnitude is great enough, and once you detect more than x hits in a small amount of time, fire the "roll" sounds. Tricky...

This is really the kind of job F$$anonymous$$OD Designer is meant for, alas not compatible with Unity unless you use a plugin (I happen to have commissioned one...).

avatar image GiuseppeB · Apr 13, 2012 at 12:24 PM 0
Share

uhm thanks! that's a big help, i will try

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

7 People are following this question.

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

Related Questions

Falling Objects Sound 1 Answer

Having an array of points(vector2), how do I create a 2d terrain? (new to unity) 2 Answers

Combine common surfaces 1 Answer

Unity3D Playing Two Sounds - OnCollision 1 Answer

Leap motion: how to pickup a custom mesh 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