Help with CFrames

Hello, im currently trying to work with cframes to make one part(Part1) follow another parts(part2)'s Position only on the X and Z axis and make it follow its rotation aswell

Video of Issue:

My code:

while task.wait() do
	script.Parent.Parent.Part_.CFrame = script.Parent.Parent.Part_.CFrame:Lerp(
		CFrame.new(script.Parent.Parent.Part.CFrame.X,0,script.Parent.Parent.Part.CFrame.Z),.15
	)
end

Thanks in advanced :grinning_face_with_smiling_eyes:

Part1.CFrame = Part1.CFrame:Lerp(CFrame.new(Part2.Position.X, 0, Part2.Position.Z) * CFrame.new(Vector3.new(), Part2.CFrame.LookVector), 0.15)

1 Like

Thanks for the help! Was a bit confused on how to pull this off :sweat_smile: