Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Problems with dragging a part?

I have a problem with dragging stuff around. The output appears nothing when I even try to click it. Can someone help me with this? Used LocalScript.

local part = game.Workspace.Log1

	local mouse = game.Players.LocalPlayer:GetMouse()
	
		function onClicked(mouse)
			part.Position = Vector3.new(mouse.hit.p.X, mouse.hit.p.Y, mouse.hit.p.Z)
		end
		
		part.ClickDetector.MouseClick:connect(onClicked)

I'm just a beginner. Thank you.

1 comment

0

Every frame (using renderstepped) try to place the part where the mouse is currently at.

1 answer

✓ Accepted answer

If you're trying to allow for players to drag things, and you're not familiar with an approach, I think you should avoid coding it without a reference. My suggestion to you, is to put a HopperBin in StarterPack, and set the BinType to Grab. When this hopperbin is equipped, players can drag any unlocked parts. Hope this helps you out...

1 comment

0

I will try. Thanks for the answer tho.

This discussion is preserved as it was. New answers, comments, and votes are closed.