Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help with Magnitude problem?

Asked by 8 years ago

There is no error in the output.

local pointA = Vector3.new(-6.402, 0.71, 72.872) -- some position
local pointB = Vector3.new(game.Players.LocalPlayer.Character.Torso.Position) -- some other position
if (pointB - pointA).magnitude < 0.1 then
    print("Close Enough")
end

Need it to print when its close enough

0
Is it within a while loop? Is filtering enabled on> TinyPanda273 110 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

Only checks magnitude once, add while loop.

while wait() do
local pointA = Vector3.new(-6.402, 0.71, 72.872) -- some position
local pointB = game.Players.LocalPlayer.Character.Torso.Position) -- Vector3.new shouldn't be used
if (pointB - pointA).magnitude < 0.1 then
    print("Close Enough")
end
end
0
What do i use instead of vector3? supermanswaqq 65 — 8y
Ad

Answer this question