Magnitude is not valid value of Vector3Value

Hi all, I’m working on an A-Chassis plugin, and as per the title, it’s giving me an error:
Magnitude is not a valid member of Vector3Value "Players.saddleup_andride.PlayerGui.A-Chassis Interface.Values.Velocity

This is the script in question

local Car = script.Parent.Car.Value
local Event = game.ReplicatedStorage.CameraEvent
local Seat = Car:WaitForChild("DriveSeat")
local Values = script.Parent.Values

while true do
	wait(0.1)
	print(Values.Velocity.Magnitude)
	print("round"..math.round(Values.Velocity.Value.Magnitude * (10/12) * 1.09728))
	print("ceil"..math.ceil(Values.Velocity.Value.Magnitude * (10/12) * 1.09728))
end

This might be a bit of an https://xyproblem.info/ situation so:

You may have guessed I’m attempting to get the speed (in km/h, rather than obscure roblox units). I’m having trouble with converting it, hence this test script. I got the math itself from the AC6 Gauges script, but it’s not replicating in my plugin.

Change Values.Velocity.Magnitude to Values.Velocity.Value.Magnitude in the first print statement. You did it correctly in the two below it.

The .Value property of Vector3Value represents the Vector itself. That Vector will then have the corresponding .Magnitude property.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.