I’ve got a client-sided part that goes to my cursor whenever I move it, but it works inconsistently and will snap to a random position at random when it’s not moving. Sometimes it works fine, other times that happens.
I assume it’s to do with the server rejecting the part movement, but I’m not sure
i’ve tried it in the studio and it works fine, here is the script i used (i do not code clean, CanCollide is false and anchored is true)
local plrs=game:GetService('Players')
local mouse=plrs.LocalPlayer:GetMouse()
mouse.TargetFilter=workspace:WaitForChild('Part')
local past=vector.zero
local maxdistance=60
mouse.Move:Connect(function()
if (plrs.LocalPlayer.Character.HumanoidRootPart.Position-mouse.Hit.Position).Magnitude>maxdistance then
past=workspace:WaitForChild('Part').Position
end
workspace:WaitForChild('Part').Position=(plrs.LocalPlayer.Character.HumanoidRootPart.Position-mouse.Hit.Position).Magnitude<maxdistance and mouse.Hit.Position or past
end)