I'm trying to make it so that a part goes to a player's torso's CFrame, but I'm not sure how to do this. I have a script that moves the part but I want it to move towards the nearest player's torso's CFrame. How would I do this? Please help.
Thank you!
local distance = 30
script.Parent.Anchored = true
for i = 0, distance do
script.Parent.CFrame = script.Parent.CFrame + Vector3.new(0,0,0.2) -- Supposed to target nearest humanoid
wait()
script.Parent.Anchored = false
end
