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 /
  • Help Room /
avatar image
0
Question by swc991 · Sep 24, 2018 at 05:31 PM · speedforceballrigidbody.addforcethrow

Cricket Ball Physics?

I have a cricket ball in my project. I want to throw the ball on button press from point A to point B with one bounce. I'm only using .AddForce(transform.forward * force); to do so.

But it's not really good. How do I make it realistic like physics of actually throwing a ball from point A to B with a specific force and decrease of force on bounce. Help will be much appreciated. Thanks

Comment
Add comment · Show 2
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 NoDumbQuestion · Sep 25, 2018 at 01:52 AM 0
Share

look into Physics materials

avatar image swc991 NoDumbQuestion · Sep 25, 2018 at 04:04 PM 0
Share

I'm using bounce. What else should I use?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by JVene · Sep 25, 2018 at 09:21 PM

Keep in mind that physics engines in games are not scientifically accurate simulations of reality (some exist, but not in games). They are based on the classic physics formulas, but fine details are summarized into parameters like "bounciness" (the name should give you a clue that this is not scientific), and since the math is processed in floats there is a limitation on scale.


That said, bouncing, rolling, spinning are among the things a game physics engine does best.


Scale is your first issue. Make sure the scale matches the expected units of Unity. To Unity 1.0 is one meter, so size your objects accordingly if you want the 'speed' of physics objects to look correct.


The default unity of mass is Kg, so establish mass appropriately. There's a catch. The range of mass is a bit limited, so you can't expect simulations to work well when comparing objects of fractions of a Kg with others of thousands of Kg's. I don't sense you have that issue, but it comes up in many games.


Next, pay attention to physics materials. Create a material for the ball and adjust for the kind of bounce and overall response you prefer. Second, pay attention to the physics materials for the surfaces and objects the ball must realistically bounce upon. You will find yourself working on adjustments for quite a while to get things right.


I built a simulation/game of a real world robotics contest (used for a club to practice strategy in preparation for competitions). Among the objectives is to shoot a 3 inch ball of 2 ounces in a 'cannon' like device on the robots. Getting the bounce right was critical. This ball is something like a 3 inch ping pong ball (bounces forever on a hard surface). The game is played on a mat which absorbes considerable amount of 'bounce energy', but the enclosure for the game is made of either metal or plastic parts with a very 'active' bounce, and a net that nearly catches the ball with no real bounce at all. Getting that to work well was a 3 day task of adjustments and comparisons. In that case I took video of the actual ball dropped from a known height onto various surfaces, as well as tossing the ball on surfaces of various types at known velocities. I used that to adjust the physics parameters.


What I find is that if you get the ball's physics material right for bouncing on the floor, it might be too active bouncing off of walls. Another issue in my situation is restitution. Most real time physics engines tend to oscillate, which means a group of balls on a hard surface would constantly jitter (small, fast vibrations) and never stop moving. The engine uses a restitution value that globally inhibits this motion at an arbitrary value, but for my simulation of a 3 inch ball that was too high (the balls tended to roll, slowing down correctly, but stopping suddenly in an odd looking way). Raising this restitution value (a threshold) caused the balls to be too jittery in some situations, so I had to accept compromises which were subsequently smoothed out in scripts attached to the ball.


I chose to allow the engine a very small restitution value, making things generally quite jittery on their own, but attached scripts to sense velocity, and establish an artificial restitution appropriately. Further, I found that bounce was not like the real objects - it was too mathematically pure in the simulation. In the real world, light bounces on the mat were not as well damped as larger bounces. This means there is not a single bounce setting, but multiple values - a lighter bounce setting on heavy strikes, and a stronger bounce setting on light strikes on the mat (this is related to the complex construction of the mat material in the real world). I simulated this with code attached to the ball, which selected a context based on material, speed and the energy of the impact on the floor.


This is a somewhat common means of dealing with the fact that the game engine physics is something of a puppet show, and you'll end up making things "look right", even if they're fudged. It is not going to be all that simple if you're particular (and I was being too particular because I needed the game to follow actual observations of physical behavior of objects the player would use in the real world later.

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

156 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 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 sphere a cricket ball? 1 Answer

Need help, the speed stacks if I press left/up, right/up, left/down or right/down. 1 Answer

RigidBody Controller Forces 0 Answers

Object jumping at high speed! 0 Answers

InvokeRepeating not working 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