How would I make a model rotate slowly to align with another part?

As the title says, I want to rotate a model slowly so the model will be facing the part itself
Here’s a little drawing of what I mean
https://gyazo.com/a35a8cb86ef662aeb49881fae06bf326

I know lookAt() exists but it’s not smooth at all, it more like teleports constantly to the location instead of rotating slowly.

Thank you for reading or even helping :slight_smile:

2 Likes

You could use TweenService or AlignOrientation

1 Like

Lerping the CFrame could do it, but I’d recommend TweenService

1 Like

You could still use lookAt(), but instead of immediately setting that to the model’s CFrame, lerp it every frame. I presume you already have some code ready to move the model. If so, you can just make a variable that contains the lookAt() and set the CFrame of the model via lerping.

So in your code that runs every frame, you could do this

local primaryPart = model.PrimaryPart.CFrame
local lookAt = CFrame.lookAt(primaryPart.CFrame, (part to look at).CFrame)
local lerped = primaryPart.CFrame:Lerp(lookAt,0.1)
model:SetPrimaryPartCFrame(lerped)

With some changes to suit your needs

There are probably some other methods, but this is what I thought of, it’s going to move it linearly so if taht’s not what you want, then use something else like TweenService

1 Like