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!
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
There's a function called MoveTo, if you use vector3 with it, you can move it anywhere! You can loop it using while true do, or maybe repeat until. Explanation: https://developer.roblox.com/en-us/api-reference/function/Model/MoveTo
Code:
local Model = game.Workspace.Model -- Your model here while true do-- If you want it to loop wait(.1) Model:MoveTo(Vector3.new(0, -0.1, 0) end