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

Problems with dragging a part?

Asked by 8 years ago

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.

0
Every frame (using renderstepped) try to place the part where the mouse is currently at. LifeInDevelopment 364 — 8y

1 answer

Log in to vote
0
Answered by
robocu3 30
8 years ago

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...

0
I will try. Thanks for the answer tho. Syntax_404 37 — 8y
Ad

Answer this question