Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I rotate my model smoothly ?

Asked by 5 years ago
Edited 5 years ago

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
0
Try CFrame:Lerp() or the TweenService SerpentineKing 3885 — 5y
0
How ? belalg1 9 — 5y
0
is this a npc you're trying to move? royaltoe 5144 — 5y
0
yes belalg1 9 — 5y

1 answer

Log in to vote
0
Answered by
royaltoe 5144 Moderation Voter Community Moderator
5 years ago

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

0
can you help me use lerp ? belalg1 9 — 5y
0
sure. dm me on discord: Lucy#4854 royaltoe 5144 — 5y
0
thank you i found the solution belalg1 9 — 5y
Ad

Answer this question