• 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 mochatony · May 24, 2011 at 04:28 PM · collisionphysics

How to make realistic ball bounce

Hi

I am new to unity, I have created a new scene with a sphere object where I set a rigid body with it and set the material to bouncy. While the ball do drop and bounce, it just keep bounce at same position and it never stops.

Is there any default unity setting I can use to make the ball bounce more realistically, as it should not bounce at same point and should stop eventually.

Thank you so much

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 HHameline · May 24, 2011 at 04:47 PM 0
Share

I like $$anonymous$$uzz5's ideas. Consider also Unity is probably treating it with the theoretical bounce which means it will never stop due to the face that there is no wind resistance, etc... So like $$anonymous$$uzz5 said add random rotation to the ball and fiddle with a value that perhaps changes the amount the ball bounces after each bounce so it will look as if it is bouncing less and less each time.

avatar image Muzz5 · May 24, 2011 at 04:58 PM 0
Share

Thanks. Do you need a script for it?

avatar image mochatony · May 26, 2011 at 02:10 AM 0
Share

Sorry. What do you mean a script for it?

4 Replies

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

Answer by hellcats · May 24, 2011 at 04:55 PM

Change the material "bounciness" parameter which says how much energy is conserved by each bounce. A value of 1 means no energy loss (and therefore it always returns to the same height). A value of 0 means total energy loss, and it will just stop when it hits the floor.

You could also use OnCollisionEnter and Rigidbody.AddForce(force, ForceMode.Impulse) to add the small pertubation mentioned in some of the other answers. An easy way to simulate a random floor is to use the Perlin noise function in the procedural examples. Perlin noise is smooth and always gives the same result for the same input. So if you use the x,y or u,v location of the contact point as input, you will get the same bounce everytime you hit the same point on the ground.

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 poncho · May 24, 2011 at 04:56 PM

you have at least 2 options

1- add a physic material and change the values as desired

2- dont use the unity physics and make your own (which is my case)

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
1

Answer by Meltdown · May 24, 2011 at 04:47 PM

By default rigidbodies in Unity have no 'drag'. Meaning no frictional forces are acting upon them or slowing them down.

Set the Drag value of your rigidbody to 1 to start, and you will see a more realistic bounce.

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
2

Answer by Muzz5 · May 24, 2011 at 04:38 PM

Actually, if you think about it, PhysX is being accurate. If you have a ball, which is not rotating, dropping onto a perfectly flat, even floor, it will bounce in exactly the same position. But it real life, our floors are not perfectly flat and even. So you could try rotating the floor very, very slightly, adding a random movement to the ball after every bounce, or making your own floor in blender (or whatever) which is less flat. You could also try adding some rotation to the ball and see if that makes a difference. A good way to simulate a non-even floor would be using perlin noise.

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

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

Physics ignore layer collision script error 3 Answers

Question on Vector3.Reflect() 2 Answers

How to avoid objects bouncing and overlapping after collision? 0 Answers

Advice for Intersecting Colliders 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