Well its kind of hard to explain but I'm currently trying to find out how can I make part move even when magnitude between player and mouse is above 50, so it will move but not above 50 distance, right now if distance between player and mouse is 51 or more, part just stuck at the last point it was and doesn't keeps moving spherically
local plr = game.Players.LocalPlayer
local char = plr.Character
local hroot = char:WaitForChild("HumanoidRootPart")
local RS = game:GetService("RunService")
local mouse = plr:GetMouse()
local p = Instance.new("Part")
p.Anchored = true
p.CanCollide = false
p.Size = Vector3.new(1,1,1)
mouse.TargetFilter = p
p.Parent = workspace
local function GetDistance(n1,n2)
local distance = (n1.Position-n2.Position).Magnitude
return distance
end
RS.RenderStepped:Connect(function()
if GetDistance(hroot,mouse.Hit) < 50 then
p.Position = mouse.Hit.Position
end
local mouse = game.Players.LocalPlayer:GetMouse()
local camPos = game.Workspace.CurrentCamera.CoordinateFrame.p
end)

2 comments
The if statement should be under the variables
These variables aren't even attached to anything, I mean they aren't used to work with something, they're in it for later use, my question is other, everything works