How would i make a part drag parts within a certain radius towards it?

basically, i want there to be a part, and if there is an unanchored part within a certain amount of studs, that part will be dragged towards the part. I’ve looked on youtube to no avail, and ive tried certain body moving thingies.

You can use workspace:GetPartBoundsInRadius() to get a list of parts within a radius of a position. You can loop over the parts and use apply impulse or change their assembly linear velocity. I did it like this with the character:

game:GetService("RunService").RenderStepped:Connect(function(dt)
	local params = OverlapParams.new()
	params.FilterType = Enum.RaycastFilterType.Exclude
	params.FilterDescendantsInstances = {char}
	params.MaxParts = 100
	local parts = workspace:GetPartBoundsInRadius(char.HumanoidRootPart.Position, 100, params)
	if not parts then return end
	for i, v: BasePart in pairs(parts) do
		if v.Anchored then continue end
		v:ApplyImpulse(-1000*(v.Position-char.HumanoidRootPart.Position)*dt)
	end
end)