1
\$\begingroup\$

I have a ball in a game that rolls around just fine with Rigidbody.AddForce(). I have other non-physics balls, however, that I control directly with Rigidbody.MovePosition().

It seems that no matter what I do, no matter how interpolation and collision detection are set, the ball does not "roll" when moved with Rigidbody.MovePosition(). It teleports, but IsKinematic is not set , as instructed by the documentation.

How do I get the ball to roll properly with Rigidbody.MovePosition()? Alternatively, if that's not possible, how do I calculate the rotations manually?

\$\endgroup\$
2
  • \$\begingroup\$ I'd be tempted to attack this from the opposite direction: calculate the velocities needed to move your balls to the positions you've chosen in one timestep, and let them roll there. This will have a little slop when changing directions, but in my experience the control remains tight. Whether this is an acceptable solution in your case may depend on exactly what gameplay you're trying to achieve — can you give us more details about the movement logic these balls use? \$\endgroup\$
    – DMGregory
    Commented Oct 5, 2016 at 1:06
  • \$\begingroup\$ You say you do not have IsKinematic set, as you found from the docs. The docs do not mention IsKinematic in this way, but they do explicitly mention Interpolate. You do still mention trying that, am I right to assume this was just a publishing error on your behalf? \$\endgroup\$
    – Gnemlock
    Commented Jan 22, 2017 at 15:19

1 Answer 1

1
\$\begingroup\$

To make the ball move naturally, you should use AddForce (to make to move in a straight line) and AddTorque (to make it roll).

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .