Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 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 /
  • Help Room /
avatar image
0
Question by TheSaviour · Dec 28, 2016 at 11:59 AM · physicsbouncing

How can I cause a sphere to bounce infinitely without gaining or losing any energy?

I'm trying to create a sphere that bounces forever, and after each bounce, it always reaches a fixed height.

I added a physic material to a sphere. I set Dynamic and Static Friction to 0, Friction Combine to "Minimum", Bounciness to 1, and Bounce Combine to "Maximum". But unfortunately, the sphere gains energy after each bounce. This results in the sphere gaining height during each bounce.

I've searched for solution online which do not require any code. But none of them are useful. My only option is to use code. Is there a way I can cause the sphere to bounce forever, without gaining or losing energy, so that it always reaches the same height after every bounce?

Comment
Add comment · Show 1
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 Owen-Reynolds · Dec 29, 2016 at 01:23 AM 0
Share

A terrible, terrible way is setting drag to a small number to compensate. 0.016 gave pretty good results (with a 10 meter drop - lower hts seem to need more drag.)

For fun, continuous dynamic doesn't help.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by lukemorel · Dec 28, 2016 at 05:20 PM

Be careful to the physic material applied on the platform you bounce on, try to add a material with zero friction. The standard assets contain some physic materials, one of them is called ZeroFriction which should be what you need for your platform : alt text (note the 'Multiply' friction combine option which will keep friction to 0 :P)

If you are on a terrain, just click on it, then you can change the physic material under the Terrain Collider option, alt text

If you are on a plane, or any other 3D object, you know how to change it ;)


terrain-collider.jpg (13.7 kB)
zerofriction.jpg (17.0 kB)
Comment
Add comment · Show 3 · 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 Owen-Reynolds · Dec 28, 2016 at 05:46 PM 0
Share

If you read the second paragraph from the OP, they already have friction set to 0. As they note, this doesn't work. The object will almost always fall a little bit into the floor during a time step. The system corrects that, but it gives some inexactness in the return bounce.

There's also nothing special about the premade physics $$anonymous$$aterials. It's easy and, I think, better, to just make and set your own (as the OP did.)

avatar image lukemorel Owen-Reynolds · Dec 28, 2016 at 06:10 PM 0
Share

The second paragraph talks about the sphere friction, I talk about the surface the sphere bounce on. You have 2 surfaces and 2 physic materials to play with.

The premade ZeroFriction physic material is just, in my opinion, a good point to start with :)

avatar image Owen-Reynolds · Dec 29, 2016 at 01:04 AM 0
Share

For fun I rechecked this (using version 5.2x). Friction and ground materials don't matter. Bounce 1/maximum on a ball is the same no matter what else you do:

o Friction has no effect on bouncing. 0 or 1 gives the same amount of bounce. I think the actual rule is that friction is applied if you were in contact last frame, and are in contact this frame (which doesn't happen when you bounce.)

o If you override the ground settings (ex: bounciness 1/maximum) then having or not having a physics material on the ground has no effect. I believe this is on purpose - I think the old manual suggested, at first, using max/$$anonymous$$ settings to avoid needing a physics material on every surface.

avatar image
0

Answer by mbmt · Mar 13, 2020 at 07:48 AM

The ancients say that the ideal value of bounciness for infinity bounce is something around 0.9803922

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.

Follow this Question

Answers Answers and Comments

97 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

Related Questions

Docking Ports for Physics Based Objects 0 Answers

Sumo Physics Bounce Question 0 Answers

[UNSOLVED] Bouncing ray cast 0 Answers

Physics Movement without Physics Reactions 1 Answer

Player Movement Not Always Responding 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