Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
2
Question by zmeinaz · Jul 09, 2012 at 06:21 AM · rotationitweensphere

Roll a ball in a circle around an object

I am pretty new to unity and I am struggling to find the best way to achieve the following behavior, this is kind of hard to describe so bear with me:

Imagine a nail in a horizontal plane and a ball on the same plane. Imagine they are connected with a string. I want to roll the ball around the nail in a perfect circle rotating on the 'string' axis. Basically I want the z-axis of the ball to always point to the nail while rolling around it in a circle.

I've been playing with iTween paths and rotations but I just can't seem to get it look right.

Does anyone know of a way to do this?

Comment
Add comment · Show 1
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 Fattie · Jul 09, 2012 at 07:58 AM 0
Share

WHAT IS YOUR "BALL" ?

is it a 3D model or what, precisely ? Pls explain. Also give it's size in meters and mass in $$anonymous$$G.

When you say "z axis" do you mean the LOCAL z-axis of the ball, or what?

2 Replies

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

Answer by Fattie · Jul 09, 2012 at 07:57 AM

A very simple solution for you:

1) have a large cube, say 2 meters across

2) put the center of that cube where your nail is

3) inside the cube, sit another object - the ball

4) move the ball to the far left edge of the cube

5) now spin the cube around (use the animator system if you like, which is very easy)

(6) additionally if you like. add a two-line script to your "ball" that just looks at it's speed over the ground at that moment. based on that speed, manually rotate the ball graphics.

(For that matter, just make the graphics rotate at a fixed speed, and you can just tune that fixed number until it looks fine to you.)

Interestingly, this is precisely how car wheels/tyres are "turned" in almost all car racing video games. The wheel/tyre is not "really" turning, it's a, er, dynamic calculation based on static "real items", and as a last final step you just cheekily rotate the IMAGE of the tyre/wheel at whatever speed your simulation has determined the tyre is squeaking over the ground at at that moment.

Note: if you want to TRULY apply forces to your rolling ball object so that it genuinely rolls, following some specific path (in your case, a circular path) ... ie, you want to genuinely, honest-to-goodness make a real simulator of the situation at hand ... you won't be able to do that. It's way too hard. You have to have a vast understanding of applying torques and forces over time. Anyone who knows how to do it won't tell you as it is secret knowledge :-)

There are also huge questions of friction, etc and what it actually means for a single sphere to roll while turning. How would you achieve that in real life? by blowing air on it, or ?

IMO for you -- force the ball to move in a circle (use the trick I describe w/ a large rectangle) and then animate the "rolling" motion as you feel is best.

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 zmeinaz · Jul 09, 2012 at 02:25 PM 0
Share

Thanks for the detailed response. I thought I might have to fake it, since the math was getting pretty complicated.

avatar image Fattie · Jul 09, 2012 at 02:57 PM 0
Share

i truly hope it helps in some way cheers

avatar image zmeinaz · Jul 10, 2012 at 05:16 AM 0
Share

I did it by setting up a game object which contained my sphere, then using iTween on each. I rotated the sphere on the z-axis and rotated the game object on the y-axis at the same time.

avatar image Fattie · Jul 10, 2012 at 06:07 AM 0
Share

magnificent

avatar image flamy · Jul 10, 2012 at 06:53 AM 0
Share

good one

avatar image
0

Answer by gOzaru84 · Jan 06, 2019 at 10:50 PM

Is this what you're looking for? A video tutorial?

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

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Make sphere rotate when controlled 7 Answers

Third person follow camera on a sphere 1 Answer

Sphere rotation in moving direction 1 Answer

Sphere "skids" on turns without rotating 1 Answer

Rolling sphere keep velocity but slow rotation 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