Im not sure where to look for a tutorial on how to make a speedometer that just displays ur speed. all the youtube tutorials or models I’ve seen have a speedometer but it has revving aswell which i dont want i just want the speed.
you need to connect the value of the walk speed toa gui and it should be good if you dont know how ask me
you can use the rotation properties of the gui . but you still need to do a bit of math to get the position of the speedometer pointer
The math is the bit im stuck on and how to align it with a speedometer gui? also how do u make speedometer guis
you can add ui corner to the gui and set the scale value to 1 which will make the ui a circle
The GUI should have a background circle, a foreground circle, and the foreground circle should have the arm of the speedometer. You then decide your min and max rotation (I suggest 45, 315). You then decide on a max speed. Then you’ll create a function which takes a speed argument, and calculates how many degrees that would be. You then rotate the foreground circle by that amount, plus your min angle as offset.
local maxSpeed = 150
local minAngle,maxAngle = 45,315
local totalDegrees = maxAngle-minAngle
local speedPerDegree = totalDegrees/150
local function calculateDegree(speed)
return math.min(minAngle+speed*speedPerDegree,maxAngle)
end
-- Testing function
while wait(.01) do
for i = 1, maxSpeed do
local deg = calculateDegree(i)
script.Parent.Frame.backgroundCircle.foregroundCircle.Rotation = deg
script.Parent.Frame.backgroundCircle.TextLabel.Text = i
wait(.01)
end
end
Okay that seems promising ill be sure to try it when i get time but how would I go about adding the numbers to the speedometer? It will be very difficult to draw so I assume it’s easier to script it.
I’d just get a texture from google
What does the anchor point of the needle need to be and where should it start like where do i put it?? e.g 180 * or 90 *
The needle is ‘fake’. So there’s a frame, which is just centered on the center. The needle is a child of that frame. That frame is what rotates, the needle just rotates because it’s a child of the frame. So all you need to do, is to make sure that at 0 degrees, the needle is pointing wherever you want it to be pointing (I recommend at 7:30 looking at a clock)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.