Better ways to add friction to a golf ball?

I am developing a golf game for BrCreator Challenge (Bloxy Golfing).

The problem is the friction I simulate when the ball travels on the ground isn’t optimal.

What should Happen is: I want it to stop faster on certain materials, and be able to stop on not so high slopes that that material, like sand/grass. I want the friction system not to interfere with a future feature i’ll add which adds spin effects where I want to.

Consider that Wind Factor is a BodyForce that uses Vector3(math.random(-35,35),0,math.random(-35,35)) and applies only while ball is midair:

Here are the methods I tried:

First Method: I Checked when ball touches ground, and then if it is multiply ball.Velocity by .9, .7, or .5 (depending of material). Problem is the ball gets lag sometimes because of this, and I don’t know why, being that there is no loop, just Touched and TouchEnded events.

Second Method: I added a bodyvelocity to the ball, forcing a 0 velocity. The strenght the bodyvelocity tries to put the ball at 0 speed is made by Touched and TouchEnded, considering ground material, just like first method. The problem here is the ball sometimes turns left or right on a perfectly flat floor.

Third Method (Currently Used): I use BodyGyro to stop ball from rotating, and I changed CustomPhysicsProperty of grass and sand to have higher friction, while putting zone has less. The Problem is I want to add a feature where you give a spin effect to the ball, and this would interfere with it.

2 Likes

couldn’t you just turn on CustomPhysicalProperties inside of the part, and then raise the friction?

wiki: BasePart | Documentation - Roblox Creator Hub

1 Like

You can try constantly multiplying the AngularVelocity of the ball by like .95 or .9 on loop to slow the ball down until it stops moving. Sadly the Roblox physics engine still doesn’t support rolling friction. So spheres will just roll for ever never stopping. You then can possibly also use the angularvelocity to apply spin to the ball.

5 Likes

Already using that, but I had to use a BodyGyro in order for it to work, as rotating objects arent too affected by friction. The problem is that I want the ball to rotate to use spin effects.

1 Like

Going to try this, thanks for the answer :slight_smile:

Old topic now. But what if you applied added counter-velocity in the event of RunService.PreSimulation?