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 /
avatar image
0
Question by microp · May 25, 2011 at 08:00 PM · rotationphysicsspherefrictionrotating

Friction issue with rotating sphere

My game involves a ship landing on a rotating spherical planet. The planet is a simple spherical object with a sphere collider and a kinematic rigidbody. It also has a gravity field script applying an attraction force to nearby rigid bodies, excluding itself, of course.

My issue arises when the ship, a triangular mesh with corresponding mesh collider and non-kinematic rigid body, lands. It doesn't rotate along with the planet, even if both physics materials have a friction of one.

Now, the planet, being kinematic, is rotated each frame using transform.Rotate(). Is it possible that doing so bypasses the physics simulation?

Is it also possible that the constant force being applied towards the center of the planet is screwing with the friction mechanics? I doubt so, because it's basically the same as using the built-in gravity feature: constant force applied in a constant direction.

I'm pretty sure that the physics setup is fine because the ship properly sticks to and slides along a plane.

Anyway, those are the theories I came up with, but right off the bat I'm not sure how I could test them. Maybe it's something else, too.

Thanks!

Comment
Add comment · Show 3
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 microp · May 25, 2011 at 08:21 PM 0
Share

Nope, I disabled gravity after a collision, and I have the same behavior.

avatar image microp · May 25, 2011 at 08:31 PM 0
Share

And yep, if I set the planet's rigidbody as non-kinematic and rotate them with angular velocity ins$$anonymous$$d, the ship does frictate properly. To frictate is a real word, isn't it? Anyways. Can anyone think of a way to make friction work with Rotate() ? I'm kind of worried that something could bump and move a planet even if I gave them a large mass.

avatar image Kailas · Jan 24, 2012 at 06:44 AM 0
Share

Frictate is most certainly not a real word.

1 Reply

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by Meater6 · May 25, 2011 at 08:56 PM

transform.rotate does not use physics engine, it just changes the transform component. A few things to try:

  1. Make the collider a separate object

  2. Add torque instead of rotation

It would be helpful if you would give the script in a edit to your question.

I hope this helps

Comment
Add comment · Show 4 · 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 microp · May 25, 2011 at 08:59 PM 0
Share

Well there isn't much code involved, really. Just a transform.Rotate(whatever) in Update(). And the gravity is irrelevant.

avatar image microp · May 25, 2011 at 09:00 PM 0
Share

Also, adding torque means that I make the planet a non-kinematic rigidbody, which I'd prefer to avoid. I'll look into your first suggestion though. It might actually work!

avatar image Meater6 · May 25, 2011 at 09:58 PM 0
Share

Yes, I see your point. For if it is non-kinematic then its rotation can be sped up or slowed if there was a car driving on it. $$anonymous$$aybe set the angular velocity to a constant vector? If you lock the planet's position it might work.

avatar image microp · May 25, 2011 at 10:21 PM 0
Share

Setting the angular velocity does work, but again, it has to be a non-kinematic rigidbody.

But I could indeed lock the planet's all three axes. That would work too. And ins$$anonymous$$d of setting the rotation directly, my script could just make sure that the angular velocity stays constant by overwriting it every frame. Yup I think I'll do that.

Sweet!

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

How can I make a wheel spin more freely using joints in Unity? 0 Answers

Make sphere rotate when controlled 7 Answers

Calculating Sphere vs. Plane Friction 1 Answer

Simulating the graphics of a rolling 3D ball in a 2D game 2 Answers

Strange sphere/physics rolling behaviour when scaled 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