How can I allow a player to drag certain models like in the style of Lumber Tycoon 2?
Some suggested this code but It doesn't give errors, and doesn't seem to work.
local model = workspace.TestModel
local RunService = game:GetService("RunService")
local UIS = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
UIS.InputBegan:connect(function(input, gpe)
if not gpe and input.UserInputType == Enum.UserInputType.MouseButton1 then
model:SetPrimaryPartCframe(CFrame.new(Mouse.hit.x, Mouse.hit.y, Mouse.hit.z))
end
end)

2 comments
I believe gameProcessedEvent is
trueif the input is successful. Dogpeinstead ofnot gpe.You have to set the primary part beforr using the method SetPrimaryPartCFrame