I know I could just use coordinates but I keep trying and it doesn’t work. I also think it would be easier to put obstacles together if I did it this way.
Don’t know if it helps but when I first taught myself tween service (which was one of the first things I learned scripting wise) this video by Alvin Blox helped a ton:
local tweenSeRVICE= game:GetService("TweenService")
local part=script.Parent--the part you want to tween
--position the part start from
local startPosition=Vector3.new(-36.898, 12.051, -3.75)
--position the part goes to
local endposition=Vector3.new(-74.164, 12.051, -3.75)
--info about tween
local tweenInfo = TweenInfo.new(
2, -- Time for the whole tween to finish
Enum.EasingStyle.Linear, -- EasingStyle https://developer.roblox.com/en-us/api-reference/enum/EasingStyle
Enum.EasingDirection.Out, -- EasingDirection https://developer.roblox.com/en-us/api-reference/enum/EasingDirection
0, -- RepeatCount (when less than zero the tween will loop indefinitely)
false, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
--tween need a goal
-- use same property names such as Size, Positiom, CFrame, Rotation
--two variables 1 for the start position goal
goaltostart={
Position=startPosition
}
--anotehr for the 2nd position the end position
goaltofinish={
Position=endposition
}
--setup variables for the two gaols above
--tween to move part to the 1st position
tweentostart=tweenSeRVICE:Create(part,tweenInfo,goaltostart)
--tween to move part to the 2nd position
tweentofinish=tweenSeRVICE:Create(part,tweenInfo,goaltofinish)
tweentostart:Play()
while wait()do--while loop so that it keeps going without stopping
tweentostart.Completed:Connect(function()--.completed will be called when the given tween stops
tweentofinish:Play()--when the tween tweentostart stops play tweentofinish
end)
wait()
tweentofinish.Completed:Connect(function()--.completed will be called when the given tween stops
tweentostart:Play()--when the tween tweentofinish stops play tweentostart
end)
end
no u need to anchor everything and place the script directly into part
also change the start and end position
not local script
you will have 2 position u want the part to move to
move the part to one location and copys its position and insert it into
local startPosition=Vector3.new(-36.898, 12.051, -3.75)–Vector3.new(here)
move the samepart to another location and copy its position and insert it into
local endposition=Vector3.new(-74.164, 12.051, -3.75)–Vector3.new(here)
local tweenSeRVICE= game:GetService("TweenService")
local part=script.Parent--the par you want to tween
--positionthe part start from
local startPosition=CFrame.new(-33.264, 11.835, -6.895)
--positionthe part goes to
local endposition=CFrame.new(-77.438, 11.835, -6.895)
--info about tween
local tweenInfo = TweenInfo.new(
2, -- Time for the whole tween to finish
Enum.EasingStyle.Linear, -- EasingStyle https://developer.roblox.com/en-us/api-reference/enum/EasingStyle
Enum.EasingDirection.Out, -- EasingDirection https://developer.roblox.com/en-us/api-reference/enum/EasingDirection
0, -- RepeatCount (when less than zero the tween will loop indefinitely)
false, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
--tween need a goal
-- use same property names such as Size, Positiom, CFrame, Rotation
--two variables 1 for the start position goal
goaltostart={
CFrame=startPosition
}
--anotehr for the 2nd position the end position
goaltofinish={
CFrame=endposition
}
--setup variables for the two gaols above
--tween to move part to the 1st position
tweentostart=tweenSeRVICE:Create(part,tweenInfo,goaltostart)
--tween to move part to the 2nd position
tweentofinish=tweenSeRVICE:Create(part,tweenInfo,goaltofinish)
tweentostart:Play()
while wait()do--while loop so that it keeps going without stopping
tweentostart.Completed:Connect(function()--.completed will be called when the given tween stops
tweentofinish:Play()--when the tween tweentostart stops play tweentofinish
end)
wait()
tweentofinish.Completed:Connect(function()--.completed will be called when the given tween stops
tweentostart:Play()--when the tween tweentofinish stops play tweentostart
end)
end
Weld all parts to one certain part and insert the script in to that part
go to models tab and find create option and click on it
in there find Weld
the on model you can click the main part first then click on the second part you want to attach to the 1st part
here is a vid i cant paste it directly so need to upload to: