How to create placement system with animations

So currently i am making a placement system for a building game i am working on but i cant seem to figure out how to add an animation to it based on what direction the player’s mouse is moving in.

Currently i have this:

local RunService = game:GetService("RunService")

local preview = workspace:WaitForChild("Preview")
local mouse = game.Players.LocalPlayer:GetMouse()

local function UpdatePreview()
	preview.Position = mouse.Hit.p + Vector3.new(0, preview.Size.Y / 2, 0)
end

RunService.RenderStepped:Connect(function()
	UpdatePreview()
end)

for my placement system and i am trying to create something like this:
https://x.com/i/status/1258330158118825985
and i only mean to create the animation when he moves the mouse and it rotates to wherever it moves. I don’t need any help with the other stuff.
Thanks.