I am trying to create a golf ball that slows down based on different types of materials. My current issue is that with default properties on both the ball and surface that it rolls on, it does not slow down at all. I have tried to enable CustomPhysicalProperties on both the ball and the surface and playing around with the Friction and FrictionWeight properties, but literally nothing changes and the ball never slows down. Am I using these properties wrong or is there a simpler way I could go about this?
Here is what happens currently with every setup I try:
I’ve tried using a script that weakens the velocity over time, but it’s really bad on performance to be used in a real game with a bunch of players.
I have also used a BodyGyro to prevent the ball from spinning, which works a little bit but it causes weird movement patterns.
I also used a BodyVelocity with the MaxForce set to (x, 0, x) and the Velocity set to (0, 0, 0) to hopefully have it slow down the ball on the X and Z axis naturally but it didn’t work at all. It would just glitch everywhere.
a bodyvelocity is probably the best way to do it. Try increasing the ball density and setting the MaxForce and P really low. Here’s an example that does ok.
The problem with that is, as the ball is decelerating, the spin continues to change the way the ball moves. If you look closely, sometimes it’ll start to curve while slowing down.
see if this helps any. It seems to get rid of the drift but I only did a few tests. Increase the density to 100 to stop it from drifting and add a bodygyro with very small values to limit the spin. The physics might look wrong with the density so high, but maybe you can find a sweet spot.
I made a golf game demo and went through all of this. Your best bet for slowing down a ball is BodyGyro. Mess with the settings and you should get some near perfect results. I say “near perfect” because there is a very minuscule amount of wobble when it stops, but hasn’t affected my game’s gameplay.
I wouldn’t use BodyAngularVelocity, because the ball rolls towards an axis at the end of travel.
BodyGyro provides a perfectly straight trajectory with no curvature or weird behavior other than the wobble.
Instead of using a BodyVelocity, use a BodyForce. Then, create a force vector that is directly opposing the velocity of the ball. This will slow it down. This is a simplified version of somthing called “drag”.
Alright I’ll try your suggestion out. Do you think it’s also possible to do this using constraints? I remember seeings some constraint called VectorForce and LineForce or something like that but I’ve never used it before.