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.