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 Manumeq · Jun 11, 2018 at 10:20 AM · collisionphysicsrigidbodykinematicfriction

[SOLVED] Ball rolling around a planet bounces off?

Hello everyone,

I am trying to accomplish the following:

I have a big sphere which serves as a planet. This shpere has in its surface several smaller spheres which act as simple balls being attracted to the planet.

alt text

Here is the code that generates the gravity of the balls to the planet:

 void Start () {
         //finds the planet game object
         puzzle = GameObject.Find("Puzzle");
         //adds force towars the center of the planet
         GetComponent<Collider>().attachedRigidbody.AddForce((puzzle.transform.position - 
                                                         transform.position).normalized * force);
 }

This works fine and the small blue balls "fall" towards the planet. Problem is, as soon as they come into contact with the planet, they all fly off violently. Both the planet an the blue ballls have a physics material with bounciness set to 0, but this makes absolutely no difference.

Doing some research I tried to adjust the planet's rigidbody to kinematic collision, and this indeed solves the problem of bouncing. However I want the small balls to rotate and move when the planet is rotated because of the friction. Simply put, the player input rotates the planet and the balls are moved reacting to it.

However, as soon as I set the planet's rigidbody to Kinematic, it stops reacting in any kind of way with the smaller blue balls. Sure, it kills the bouncing problem, but it also stops any other kind of interaction.

Is there any way to tweak collisions/rigidbodies to solve this?

Image of the rigidbody settings, small balls(left) and planet (right): alt text

EDIT: see my own answer bellow for my solution.

imgonline-com-ua-twotoone-6wor0xqjzxhj-1.png (167.8 kB)
captura.png (244.7 kB)
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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by UnbreakableOne · Jun 11, 2018 at 05:56 PM

Rotate as in rotate around themselves? Maybe using torque?

I don't understand why you use rigidbodies, at least for movement. Why not a simple movement vector and translate towards it or set it as velocity of your rigidbodies.

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 Manumeq · Jun 13, 2018 at 07:23 AM 0
Share

Yep, add torque did the rotation problem for me. Thanks a bunch!

The reason I use rigidbodies is because I want to move the small balls with friction from rotating the planet, and this is the method I thought of.

Answering your question, using a simple translate was the first thing I tried but friction didn't seem to work if done that way.

avatar image
0

Answer by Manumeq · Jun 13, 2018 at 07:25 AM

For anyone who finds this post with a similar bouncing problem, here is the solution:

Just set the bounce combine to "multiply" instead of "minimum" in your physics material properties. For a reason I still don't understand, it seems if the bounding is set to 0, minimum doesn't seem to work, and anything multiplied by 0 results in 0 bounciness, so that did the trick for me.

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

243 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image 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 prevent a kinematic rigidbody from going through static colliders 0 Answers

Rigidbody is colliding terrain on isKinematic = false. call although meshes don't touch 0 Answers

Move rigidbody cube without it tumbling 2 Answers

Is there a way to limit animation on collision? 1 Answer

Why Does Bounciness Affects Rigidbody Velocity? (SOLVED) 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