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

How do I make a model move smoothly across the map?

I haven't started the script yet but I want to know the best way to make a model move across the map without lag and smoothly. Please help me

1 comment

0

There is a method called TranslateBy(). If you want to do more than that, I recommend using a PrimaryPart and using PrimaryPart-related functions. I don't know what you mean by "...without lag" because there are many types of lag that can occur . With knowing what lag happens more, you can change your code to be less laggy

2 answers

Set the Model's PrimaryPart (under the Model's properties, click the PrimaryPart box and your cursor should change. Next, click a part from workspace.)

You can use a for i loop to lerp the PrimaryPart. Lerping is like tweening.

local PrimaryPart = workspace.Model.PrimaryPart

local Point1, Point2 = workspace.Point1, workspace.Point2 --create two points; Point1 is the start point, Point2 is the finish point

function Lerp()
	PrimaryPart.CFrame = Point1.CFrame
	for i = 0, 1, .1 do -- .1 determines the steps or increments that move the part (suggest keeping it below .2). 0 and 1 represents the progress.
		PrimaryPart.CFrame = PrimaryPart.CFrame:lerp(Point2.CFrame, i) -- tweens the primarypart's current cframe to point2's cframe
		wait()
	end
end

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