This post is related to my previous post.
As the cameraDistance variable gets bigger, how do I make the player move faster?
This post is related to my previous post.
As the cameraDistance variable gets bigger, how do I make the player move faster?
You would need something called a ratio
RunService.Heartbeat:Connect(function(deltaTime)
local distance = (game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.Position - workspace.CurrentCamera.CFrame.Position).Magnitude
local ratio = distance / 100
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16 * ratio
end)
The further the player is away from the camera the faster they will move, I put 16 because that’s what it’ll scale the walkspeed from
Hello again!
Speaking in respect to your previous topic here is the breakdown:
cameraDistance
variable.-- In the RunService loop.
local distanceFactor = cameraDistance/maximum_cameraDistance
Character.Humanoid.WalkSpeed = 16*distanceFactor
This would scale it linearly.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.