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

How do I use TweenService for MoveTo?

Asked by
tek_o 56
5 years ago

I've been doing a lot of work with MoveTo but I am really not a fan of how it moves all at once. Is there a way to get the model to smoothly move instead of just teleport?

This is what I've been trying to do:

local TweenService = game:GetService("TweenService")
local Part = game.Workspace.Plane

local Info = TweenInfo.new(3, Enum.EasingStyle.Quart, Enum.EasingDirection.InOut, 0,true,0)
local Goals = {Position = Part:MoveTo(Vector3.new(-19.25, 10, 70.739))} 
local Goals2 = {Position = Part:MoveTo(Vector3.new(-19.25, 0.5, 70.739))}
local Tween = TweenService:Create(Part,Info,Goals)
local Tween2 = TweenService:Create(Part,Info,Goals2)

while true do
    Tween:Play()
    wait(4)
    Tween2:Play()
    wait(4)
end

1 answer

Log in to vote
0
Answered by 5 years ago

Lines 5 and 6 should look like this:

local Goals = {Position = Vector3.new(-19.25, 10, 70.739)}
local Goals2 = {Position = Vector3.new(-19.25, .5, 70.739)
0
I know. I'm trying to smoothly move a whole model. tek_o 56 — 5y
0
Use SetPrimaryPartCFrame then. Make sure PrimaryPart isn't nil. User#19524 175 — 5y
0
What should the primary part be? tek_o 56 — 5y
0
The primary part. User#19524 175 — 5y
0
Of your model. The one that you may mostly use. User#19524 175 — 5y
Ad

Answer this question