How do I make my placements autorotate?

You can write your topic however you want, but you need to answer these questions:

  1. What am I trying to achieve? The autorotation type system that this game has: (1) (1)

As of right now im using a R and T based system to rotate and turn the notes but i want to make it automatic, ive done some research and i think TargetSurface has something to do with this but i cant find out how to use that to automatically rotate. Any help is appreciated!

Here is a tidbit of my code for the manual rotation system.

	if PlacingObject == true then
		Mouse.TargetFilter = PreviewObject
		if PreviewObject:FindFirstChild("MainPart") then
			local ObjectCFrame =, Mouse.Hit.Position.Y + PreviewObject.PrimaryPart.Size.Y/20, Mouse.Hit.Position.Z)
			local ObjectAngles = CFrame.Angles(math.rad(turnamount), math.rad(RotationAmount), 0)
			PreviewObject:SetPrimaryPartCFrame(ObjectCFrame * ObjectAngles)