Locked in position when clicking a tool

Hey my fellow programmers! I am trying to get a tool to be held in my hand when I pick it up.
When I click on it, the tool is in my hand, but I get stuck in a position and can’t move.
Here is my code:

local click = script.Parent.ClickDetector

local function pickUp(player)
	tool.Parent = game.Workspace[player.Name]
end

click.MouseClick:Connect(pickUp)

Is there a way I can fix this issue?

Check if the Tool’s Handle isn’t anchored :thinking: Or you could just use the EquipTool function:

local click = script.Parent.ClickDetector

local function pickUp(player)
    tool.Handle.Anchored = false
	player.Character.Humanoid:EquipTool(tool)
end

click.MouseClick:Connect(pickUp)
1 Like