How To Make Ball Rotate when Player is Moving

I’m currently trying to find out how to make a ball rotate when the player is moving; something similar to this.

Here is a clip of my version;

The ball is attached to the player with a Motor6D Weld

1 Like

Whenever you update the ball (ie in a RenderStepped function) compare its current position to its previous position to get its movement direction. Taking the cross product of this with the yAxis will give you the axis its rolling around. You can them multiply the balls CFrame with a rotation around that axis.

Hey, I understand what you mean however, I’m not quite sure how I could put it in a script. could you give me a quite example to help me out here.

When I configure the script to the work of the ball I’ve made the ball does not rotate and instead the player glitches out like this;

I’m assuming this is because of the Motor6D Weld and I’m wondering if there is a alternative to this.

I created a script like this for a car. You just need to take the velocity of the ball and use Vector3:Cross with either the global Y axis or the one relative to the normal of the part below the ball. Remember to update the CFrame of the ball using ball.CFrame *= rotCFrame. You can also make this relative to the size of the ball by dividing one of the lengths by two and dividing the velocity by that number.

could just make an animation for the ball if it has a motor6d setup

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.