Hey guys, so I was trying to experiment making my own friction system.
So you know like in real bowling, you can hook the ball and it'll skid down the lane because of oil, but then when there's lesser amounts of oil on the lane, the ball will start to change direction based on the rotation applied to the bowling ball.
Roblox does all the physics for me. But I'm not totally in love with the physical options.
Anywho, I just wondered if I could see an example code of how to do the following (I tried to do it, but failed when trying to revert the angular velocity of the ball..)
So, say we apply RotVelocity to the bowling ball part. Then, give it velocity to skid down a long part with no friction. (the ball would never hook, just keep skidding.)
Then, we could use, raycasting for example, to see if the ball is currently gliding on a part with or without friction. If the ray detects that it's time for the ball to hook, we could proceed with the next step:
Since there's angular velocity on the ball still, we need to reduce that all the way to 0. And as it reduces, we need to then apply velocity to the ball to send it in the direction of the hook. (the number of velocity would apply on the hook potential of the bowling ball. stronger ball = more hook.)
This is where I got stumped though:
Fixing the RotVelocity of the bowling ball so it's no longer spinning to the left, I want it to act like in real bowling, when the ball hits the friction, the "RotVelocity" of the bowling ball turns into velocity alone.
Sure hope that makes sense.. Thanks!
|