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?

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 :slight_smile:

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.

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