Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 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
7
Question by sipinii · Feb 27, 2014 at 08:15 PM · ballbounceheightsame

How to make a ball bounce always to the same height?

Hello. My ball has a bounciness of one. Still every time it hits the ground it bounces a little higher than it was before. I want it to return to the same height every time it bounces and I've tried to use different things for the ball to bounce off from but the same problem occurs every time. All fricitions, gravity etc. supposely have the default values as I've just downloaded Unity and started a new project.

WHAT TO DO?

Comment
Add comment · Show 6
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 Nanobrain · Feb 28, 2014 at 12:12 AM 0
Share

So, are you saying that you want the ball to bounce over and over again, and each time it bounces, it bounces up to the same height?

Or, are you saying that the each time the ball first bounces, you want that first bounce to bring it up to the same height always?

Have you tried changing the default values...removing friction what not?

avatar image sipinii · Feb 28, 2014 at 10:24 AM 0
Share

I want the ball to bounce over and over again to the same height. $$anonymous$$y ground (a box collider) doesn't have any physic material on it and I've tried to change the ball's frictions but only drag and bounciness seem to affect the bouncing height.

And I forgot to mention that my ball's drag is zero. So when the bounciness is set to 1, isn't the ball supposed to always return to the same height every time it bounces?

avatar image TurboHermit · Feb 28, 2014 at 11:16 AM 0
Share

You could remove the bounciness in total and just AddForce via script on collision with the ground.

avatar image IHateGlamour · Dec 08, 2015 at 08:12 PM 0
Share

I have the same problem. I just want to let the ball bounce, without writing code for it, why does it jumps higher each time, given that the bounciness is 1, it should be the same height...

avatar image MiDuS · Feb 19, 2016 at 11:02 PM 0
Share

Hi, i need help with same problem, did you find out how to do it`?

Show more comments

3 Replies

· Add your reply
  • Sort: 
avatar image
8

Answer by derianmeyer · Nov 27, 2016 at 03:02 PM

@sipinii

After digging around the forums I found the answer posted by jeffreyschoch (link at the bottom).

On the ball, set your Collision Detection to "Continuous" (it defaults to "Discrete"). I left Interpolate at "None". I tested and it works great!

https://forum.unity3d.com/threads/my-ball-bounces-rebounds-on-the-paddle-without-physics-material.410009/

Comment
Add comment · Show 5 · 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 Andaho · Mar 06, 2017 at 04:13 PM 1
Share

@derianmeyer This appears to be the correct answer, and not the answer using the hack of "0.9805824" (which has a higher vote).

I googled, to find this answer, when following the udemy unity course (It's not that good, so I'm not sure I'd recommend it) - In his video, his ball was still set to Discrete, but always returns to the same point - but for me, it wasn't - So it's weird that in the video, his is set to Discrete and returns to the same point, but for me I had to set it to Continuous (maybe it has something to do with different versions of unity - I'm using the latest version of 4.6, as the video recommends, but maybe he's using an earlier or later version) - I don't know.

avatar image leosbrf Andaho · Mar 13, 2019 at 10:47 PM 0
Share

I think we took the same course. His collision detection is still set to Discrete, but it does NOT return to the same point! The video is wrong.

And yes, this is the correct answer.

avatar image cmmiller1111 · Mar 17, 2017 at 07:57 PM 0
Share

agreed, this is the real answer

avatar image hamburml · Mar 06, 2018 at 01:00 PM 2
Share

I've set the collision detection to "continuous dynamic". Interpolate is still None. Physics $$anonymous$$aterial's Bounciness is set to 1, friction (dynamic and static) is set to 0. Friction Combine and Bounce Combine is set to $$anonymous$$aximum.

The Ground has a Box Collider which doesn't have a $$anonymous$$aterial added. Unfortunately my sphere get's higher than it was before. Any ideas? Using Unity 2017.3.0f3.

Thanks!

avatar image hk1ll3r · Nov 08, 2019 at 09:17 PM 2
Share

In 2019.3 setting the collision detection to (discrete / continuous / continuous dynamic / continuous speculative) + interpolate (none / interpolate) doesn't help. Had to stick to the other solution of setting the bounciness slightly below 1.

avatar image
5

Answer by leonalchemist · Apr 21, 2015 at 07:19 PM

After some testing my physics object has bounce combine set to maximum, friction to minimum and bounciness to 0.9805824, its not perfect but this is pretty darn close to a perfect bounce, even if left an object to bounce for an hour it will pretty much and no visible difference even zoomed in.

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 reevthechameleon · Mar 12 at 03:21 AM

I have found that, for whatever reason, attaching this script to the ball cause it to bounce back to the same height, even when "Collision Detection" is set to "Discrete":

 using UnityEngine;
 
 public class Bounce : MonoBehaviour{
     private Vector3 vPrevPos;
     void FixedUpdate(){
         vPrevPos = transform.position;
     }
     void OnCollisionEnter(Collision c){
         transform.position = vPrevPos;
     }
 }

The condition I use is to drop the ball onto the plane from 5 units above it and let the ball bounce for 15 minutes, then confirm that the maximum height of the ball is still 5 units. I use Physics Material with friction of 0 and bounciness of 1 on both the ball and the plane, and make sure that drag on Rigidbody Component of the ball is 0. I use Unity version 2019.4.16f and 2020.3.30f.

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

33 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

Related Questions

How to make bounce ball always the same height 1 Answer

How do I make a ball have force where it bounces and adds force in the direction it is going at? 0 Answers

How to move an object without impacting it's natural gravitational behavior 1 Answer

I can't jump the ball like I want 0 Answers

How far ball (cirlce object) roll? 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