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 /
avatar image
0
Question by varunar · Jan 09, 2018 at 03:14 PM · physicsbuttonforce

How to achieve realistic bowling in cricket game?

I'm currently working on a cricket game (PC) and want to achieve realistic bowling. I have tried something by applying some force on the ball. I'm new to this and would like to how bowling is implemented in games and if have a suggestions please tell me.

Thanks.

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by JonPQ · Jan 09, 2018 at 05:26 PM

I would suggest using unity physics for the gravity and ball bounce, and adding in your own pseudo real physics for the other features. Assuming you want... 1) curve in the air from polish on one side of the ball.... 2) bounce off grass from spin on the ball 3) bounce off grass from seam 4) possible some kind of skid low, or bounce high, based on spin also.

IF you are doing slo-mo camera so you can see what the ball is doing... you might want to do things more accurately... Cheap version.... for curve in air, just add a side force to accelerate the ball left or right... until ball bounces. Accurate version... do dot produce between ball travel direction and ball's right vector (shiny or dull side of ball) when dp result =0 do maximum curve force, when its 1 or -1, do no force... this is accurate and will work and look right in slo mo also.

for spin / seam deviation, 2 and 3 have onCollision check, and modify the forward vector when the ball bounces... (and stop lateral ball spin... add forward ball spin) You will have to experiment here with how much force to add, based on some magic constant K, ball speed, spin rate, and bowlers skill value, and if you want... surface grip. (more grippy in dry weather / yellow grass. more slippy with green grass)

4) skidding/kick. not sure if Unity can do this built into its physics... but if not, you'll again need to modify the vector after collision... this method can also be used for spin deviation, but not seam... get axis of rotation from rigid body, and add force in direction at 90 degrees to the spin axis spinRate K, and also some to the Y velocity (increase or decrease) to reduce bounce or add higher bounce.

for 3) seam. either add random left right direction deviation, or random left/right force. If it needs to look accurate in slow mo camera.... then you'll need to figure out if the seam is hitting the floor... which would be if the Right vector is nearly horizontal... (assuming right vector is at 90 degrees to the seam) then apply force along right vector depending if the seam is tilted left or right (check Y component of right vector to get the tilt)

Hope this makes sense and is helpful. Good Luck

Comment
Add comment · Show 1 · 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 varunar · Jan 09, 2018 at 07:28 PM 0
Share

First of all thanks for the fast reply. By the way can you provide code for this, just the conditional statements ? Because I'm not sure that I understand entirely what you said . Also how to apply the maximum curve force? If you could explain a little more that will be very helpful.

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

143 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

Related Questions

Returning a rigidbody back to its original x and z rotations through physics forces. 2 Answers

Get result (force & torque) of AddForceAtPosition? 2 Answers

Why is force only being added in the same direction? 1 Answer

How to get Satisfying Collision Physics 1 Answer

ForceMode.Acceleration estimated dst != covered dst with a single Addforce in effect 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