Why does lerping this rock not work?

Pretty self explanatory from title, all print statements are running rocks just not moving.

local rock = game.Workspace.Rock

script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then 
		print("PLayer touched")
		if rock then 
			print("Found rock")
			for i = 0, 1, 0.001 do
				print("lerping")
				task.wait()
				rock.CFrame:Lerp(hit.Parent.Head.CFrame, i)
			end
			end
	end
end)

Also no errors in the output

Because you arent telling the rock to move, CFrame:Lerp() will return the Interpolated CFrame as a value, it wont assign the CFrame by itself, so from there you have to manually apply it as the new CFrame:

rock.CFrame = rock.CFrame:Lerp(hit.Parent.Head.CFrame, i)
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.