I'm currently making a CFramed roller coaster, I would just like to know if there is any way to script a CFrame so that the model goes to the position of another block instead of manually scripting each move.
COMMUNITY QUESTION
How do I CFrame block to block?
1 answer
Sure, looks like this:
-- To instantly teleport a part, do this
local PartToCFrame = game.Workspace.Part
local GoalPart = game.Workspace.GoalPart
PartToCFrame.CFrame = CFrame.new(GoalPart.Position)
Edit: If you would like to control how long the move should take, You should use TweenService. This looks like this:
local TweenService = game:GetService("TweenService")
local PartToControl = game.Workspace.Part
local GoalPart = game.Workspace.GoalPart
local Goal = game.Workspace.GoalPart.Position
local tweenInfo = TweenInfo.new(
5 -- Time that it will take to move the part
-- There are more arguments that you can pass here, to search them refer to link below
)
local MoveAction = TweenService:Create(PartToControl, tweenInfo, Goal)
MoveAction:Play()
Hope this helped! - Zyrun
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
In a way this is what I was looking for... I was looking for more of something that I could control the speed and such.
Edited to your standards, please accept answer if it is what you wanted :)