How can I make a model move between two bricks?

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:

2 Likes

Thanks! I will check it out. thank you all for the help!

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

4 Likes

Does it need to be unanchored? its not working

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)

2 Likes

wait nvm im dumb you put it already
lol

dont edit gaolttostart or gaoltofinish

i already pasted the coords and it didnt work, is it because the thing im trying to move is a model?

you need to weld all the parts together

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
3 Likes

i could just make it a random floating brick but i wanted it to include the jet with fire coming out the bottom to add some realism.

2 Likes

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:

2 Likes

There is a simple yet effective way I would like to suggest, how would unions work? They take all parts and treat them as one.

You mean convert all parts to into one
or
for loop everything inside the model
or is there another way
MoveTo can be used on model but it can’t be done using tween
if there another way then i am not sure

2 Likes

If you select all the individual parts in a model or anywhere in Studio, then press model > Union, you get a part on its own, but now I just realised it wouldn’t work with his build because it contains “FireEffect”! Sorry for the inconvenience but if anyone else stumbles upon this comment and need this! Here you go! :happy1:

2 Likes

Thank You! you’ve helped me alot. :slight_smile:

1 Like

@Aanggoodluck ive got a problem, look at this screenshot:

can you show me the parts in the explorer inside this model
never mind that

i really dont know what the actual issue is

:+1:

1 Like

i have found a model that does exactly what i want it to, and it actually moves the character! thanks everyone for trying to help you are all amazing! i hope you all have a good day. :slight_smile:

1 Like