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

How do I make a model move? ( Advance Help needed )

Ok, the title of this makes me sounds like a beginner, but that's not the case in this situation. I know that you can just change the CFrame of the part every 0.1 seconds or stuff like that. But what I need is something better, don't tell me to use Translateby or BodyMovers because I'm pretty sure that wouldn't work either.

Ok, so what I want to know is how they animated the train in JailBreak or the moving parts In Tower Of hell or any moving object In any other good game.

BodyForce would work great if only you could make the part anchored, but you can't. I need something That makes the part move smoothly, something that doesn't make the part look like its laggy on other devices, something you can step on and move along with.

if only BodyForce could be applied to anchored parts :(

Thank you for your time!

2 comments

0

You can just use tweening, look into TweenService

0

Do any of these work? If so, accept one, so people don't keep answering.

3 answers

✓ Accepted answer

#Lerping!

Before you watch this learn about CFrame, moving on.

Lerping is a easy way of moving blocks! But very smooth and persice

here is how to lerp a part

local Part = game.Workspace.Part -- the part you want to lerp
local Part2 = game.Workspace.Part2 -- the part you want to lerp it to

for i = 0,1,.01 do -- It will go from 0 to 1 by 0.1 at a time and we are setting it to I
wait() -- waits since it's a while loop
Part.CFrame = Part.CFrame:Lerp(Part2.CFrame, i) -- It will lerp the part to the other part by using the i variable from last

You can also do it without a part2

local Part = game.Workspace.Part -- the part you want to lerp
local Part2 = game.Workspace.Part2 -- the part you want to lerp it to

for i = 0,1,.01 do -- It will go from 0 to 1 by 0.1 at a time and we are setting it to I
wait() -- waits since it's a while loop
Part.CFrame = Part.CFrame:Lerp(CFrame.new(0, 50, 0) * CFrame.Angles(0,math.rad(45), 0), i) -- It will lerp the part to the other part by using the i variable from last

2 comments

0

Thanks, worked great, but I still have this issue that when you stand on the part you move along with it.

0

Oh! I have scripted in a long time and i have also not figured that one out

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