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

Can someone help me move a model from one place and back again?

Asked by 3 years ago

I have this basic script that's meant to move a model from point A to point B. Here it is:

X=script.Parent

while true do
wait()
for i= 1,10 do
X:TranslateBy(Vector3.new(0, 0, -464.487))
wait(1)
end
for i= 1,10 do
X:TranslateBy(Vector3.new(0, 0, 464.487))
wait(1)
end
end


What I need to script is a model moving a moderate speed, flying over to one place and then shifting back to its original position. Instead, my script teleports it 4 times, eventually making it's destination, and teleporting back the same way. May someone help me fix this script?

0
Okay, so if you want to move the part to one place smoothly you would use Lerp or TweenService (they’re practically the same thing.) I suggest watching TheDevKing’s video on these two things if you want to know how to use em. abstractedfrostbite 110 — 3y
0
Thank you, God bless TiwamButDumber 10 — 3y

1 answer

Log in to vote
1
Answered by 3 years ago

Did you know that you can tween parts not just GUI objects?

Look into it here.

0
I appreciate your help! TiwamButDumber 10 — 3y
Ad

Answer this question