How do I use Mouse.Target and Mouse.Hit on mobile?
It works on PC, but not mobile.
Any suggestions?
Code:
m.Button1Down:Connect(function()
mDown = true
if completed == false and m.Target == workspace.Wires.BlueWireStart then
while mDown do
workspace.Wires.BlueWire.Position = Vector3.new(
m.Hit.X,
2,
m.Hit.Z
)
if (workspace.Wires.BlueWire.Position - workspace.Wires.BlueWireEnd.Position).magnitude < 4 then
workspace.Wires.BlueWire.Position = Vector3.new(-60.5, 2, 202.1)
completed = true
break
end
wait()
end
elseif completed == false and m.Target == workspace.Wires.BlueWireStart.BrokenPart then
while mDown do
workspace.Wires.BlueWire.Position = Vector3.new(
m.Hit.X,
2,
m.Hit.Z
)
if (workspace.Wires.BlueWire.Position - workspace.Wires.BlueWireEnd.Position).magnitude < 4 then
workspace.Wires.BlueWire.Position = Vector3.new(-60.5, 2, 202.1)
completed = true
break
end
wait()
end
end
end)
Edit: Still want a better version, but apparently you just have to like double tap it or something.