Hi there!
I’m trying to script a car. Everything was going well until I saw that my speedometer stays at 1 KPH even when I’m not moving.
How can I fix this??
Here’s my code to set the speed on the label:
local runService = game:GetService("RunService")
local speedometer = script.Parent
local speedLabel = speedometer.Speed
local car = speedometer.Parent.Car.Value
local chassis = car:WaitForChild("Chassis")
local conversionCoeff = 1.0
runService.RenderStepped:Connect(function()
local speed = chassis.AssemblyLinearVelocity.Magnitude
speedLabel.Text = math.max(0, math.floor(speed))
end)