Help with PluginMouse.Move

Hello, today i’m trying to make a plugin that allows you to clone objects and move them around the map for placing them, the problem is that the Mouse.Move event won’t work. This is my code:

Bindables.TogglePositioner.Event:Connect(function()
	if functions:GetToggledPositioner() == true then
		canMove = true
		print(canMove)
		
		for i, object in pairs(Selection:Get()) do
			if object:IsA("Model") and object.Parent == game.Workspace then
				local newObject = object:Clone()
				newObject.Parent = game.Workspace
				print("Cloned")

				Mouse.Move:Connect(function()
					print("Mouse moved")
					if canMove == true then
						print(canMove.." 2")
						newObject:SetPrimaryPartCFrame(Mouse.Hit.p)
					end
				end)
			end
		end
	else
		canMove = false
	end
end)

The code works until at “print(“Cloned”)” line right before the Mouse.Move events begin (this: image )

I tryied to check if i made it correctly on the developer hub but it looks fine at me, also i tryied to add print so i can check where the code breaks.

I don’t get any error in the output.

Do you have any idea about why this won’t work?

1 Like

Nevermind i solved it my myself.