How to find part's velocity in one direction

image

I have a part and I just need to find the speed it’s moving to the left

I’ve tried AssemblyLinearVelocity, but it gives weird results when the part is moving across both the X and Z axis, and the same issue happens with :VectorToObjectSpace()

Maybe something math related to velocity and lookVector?

Dot product

if uis:IsKeyDown(Enum.KeyCode.A) then
	local NewVelocity
	
	NewVelocity = cam.CFrame.RightVector * -18
	
	HRP.Velocity = NewVelocity
	
	local RightVector = HRP.CFrame.RightVector
	local characterVelocity = HRP.Velocity
	
	local resolvedVector = RightVector:Dot(characterVelocity)/RightVector.Magnitude
	
	print(math.round(resolvedVector))
end

This prints basically the same issue as before, I can send a video if it helps
Does it work with RightVectors? I haven’t used :Dot() before either

Not sure what the exact issue is, otherwise I would suggest the example in the linked post which should be tested.

I think it’s this. Walking diagonally changes the speed
I need to know the speed while traveling diagonally. In the example which I quoted, I would need the speed to say 16 even while you’re travelling diagonally