In my game, the player controls a ball. Currently, I have the system working with the code and setup below. However, there is one issue: the ball feels heavy and unresponsive when trying to switch direction.
All the solutions I have found online involve increasing the force and therefore the speed. I don’t want to make the speed any faster though. How can I make the ball feel less heavy without increasing the maximum speed? I think I basically need to detect when the direction of the ball changes and add a higher force until it switches direction.
Ball setup (sphere part containing two VectorForces):
My code for moving the ball:
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
RunService.RenderStepped:Connect(function(dt)
local newMoveDirection = Players.LocalPlayer.Character:WaitForChild("Humanoid").MoveDirection
currentBall.MoveForce.Force = newMoveDirection * 1500
-- apply drag force to limit the speed
local speed = currentBall.AssemblyLinearVelocity.Magnitude
if speed > .1 then
currentBall.DragForce.Force = -currentBall.AssemblyLinearVelocity.Unit * (speed^2) * Vector3.new(1, 0, 1)
else
currentBall.DragForce.Force = Vector3.zero
end
end)
Video of the “heavy” feeling problem:
(notice how it takes a while to slow down to change direction)