Hello im a fresh new scripter, i searched on youtube for how to make moving parts. But it's not working. And i want them to move smoothly
Like this?
local Part = (Insert object here) -- For example workspace.Part local Vector3Pos = Vector3.new(number,number,number) -- Target local Second = 0.5 -- Optional local X,Y,Z local DX,DY,DZ = (Part.Position.X-Vector3Pos.X),(Part.Position.Y-Vector3Pos.Y),(Part.Position.Z-Vector3Pos.Z) for i=1,(Seconds*50) do X=Part.Position.X-(DX/50) Y=Part.Position.Y-(DY/50) Z=Part.Position.Z-(DZ/50) Part.Position=Vector3.new(X,Y,Z) wait(Seconds/50) end
/* edit */ or this?
local Part = (Insert object here) -- For example workspace.Part local Vector3Pos = Vector3.new(number,number,number) -- Target Part:lerp(Vector3Pos, (insert number here (alpha))) -- Forgot to mention tweening
this is simple so lets say you have a part that is 5 studs from the center of the map now you want it to move smoothly without using Vector 3 ig i don't use those here is what you do
local part = script.Parent for num = 0, 1, 0.1 -- How many times it will loop idk part.CFrame = part.CFame:lerp(CFrame.new(0,0,0), num) wait()
the should smoothly move the brick in the center of the map I didn't test it.