Im currently working on a game trying to imitate the feeling of vr without vr, so anyway I need to calculate the velocity of the left hand and the right hand this is my current code:
local mp = 13
function getDis(v1,v2)
local x1 = v1.X
local y1 = v1.Y
local z1 = v1.Z
local x2 = v2.X
local y2 = v2.Y
local z2 = v2.Z
local x = 0
local y = 0
local z = 0
if x1 > x2 then
x = x1 - x2
else
x = x2 - x1
end
if y1 > y2 then
y = y1 - y2
else
y = y2 - y1
end
if z1 > z2 then
z = z1 - z2
else
z = z2 - z1
end
return Vector3.new(x * mp,y * mp,z * mp)
end
“mp” is just the value that the vectors get multiplied by, however sometimes this causes the object to go in the complete opposite direction. Any help would be very appreciated.
And because I’m using :SetPrimaryPartCFrame the actual velocity property isn’t active which is why this entire issue occurred.