Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I rotate my model smoothly ?

I have a model and I want it to rotate smoothly toward a part every 3 sec, I used CFrame but the model did not rotate smoothly.So how can I rotate my mode smoothly ?

Script:

npc = script.Parent
npc.PrimaryPart = npc.Part

while wait(3) do
	p = workspace.bluePart.Position
	npc:SetPrimaryPartCFrame(CFrame.new(npc.PrimaryPart.Position , p))
end

4 comments

0

Try CFrame:Lerp() or the TweenService

0

How ?

0

is this a npc you're trying to move?

0

yes

1 answer

✓ Accepted answer

You can use MoveTo() to move the NPC to a certain position.

script.Parent.Humanoid:MoveTo(vector3 position you want to move to)

--so if i wanted to move to (0,0,0) it would be:
script.Parent.Humanoid:MoveTo(Vector3.new(0,0,0))

Your current script gets the blue parts position and teleports the model there every three seconds. You could do it that way if you'd like, but it's not going to play any animations. If you want the character to straight up move to the position without any animations you can use lerp or tweenservice like serp said. Tell me which you want to do and I can help you out with that

3 comments

0

can you help me use lerp ?

0

sure. dm me on discord: Lucy#4854

0

thank you i found the solution

This discussion is preserved as it was. New answers, comments, and votes are closed.