Hey! I’m trying to code Beams to have a Starting Point on a Part, and the End Point to be the Mouse Cursor.
for _,conn in pairs(Connections) do
if (conn ~= nil) then
conn:Disconnect()
conn = nil
end
end
Connections["Mouse_Moved"] = Mouse.Move:Connect(function()
-- checking if selected
local function check_selected()
for _,v in pairs(Main.Start:GetChildren()) do
if (v:FindFirstChild("Dragger")) then
if v:GetAttribute("Selected") == true then
return v.Dragger
end
end
end
return false
end
local dragger = check_selected()
if (dragger ~= nil and dragger ~= false) then
warn'test'
local position = Vector2.new(Mouse.X, Mouse.Y)
local size = Vector2.new(Mouse.ViewSizeX, Mouse.ViewSizeY)
local norm = position/size
print(norm)
dragger.Position = norm
end
end)
I create a Beam Instance above, and set the Starting Point to an already selected Part. How would I constantly update the End point and set it to the Mouse Cursor?