How would I make this group of parts move from its position?

I have a group of parts that move. I want it to move up 1 and then wait(1) and go down 1.

This just moves the parts to these positions.

How would I make it so that the parts slowly float up and down from its position?

local model = script.Parent

while wait(1) do
	model:MoveTo(, 1, 0))
	model:MoveTo(, -1, 0))

First you need to choose a main part in the model and weld all the other parts to it. Then there is a property in the model called PrimaryPart, and set that to the main part. Then move the primary part and it will move the whole model.

The edited script:

local model = script.Parent

while wait(1) do
	model.PrimaryPart:MoveTo(, 1, 0))
	model.PrimaryPart:MoveTo(, -1, 0))
1 Like

TweenService might come in handy, it’s a very powerful tool for animations!

Since you will be Tweening a model, I recommend reading this.
Introduction to Tweening Models - Resources / Community Tutorials - DevForum | Roblox


I’ll check it out now. Thank you

This doesn’t work on meshes apparently in models?

  16:24:08.325  MoveTo is not a valid member of MeshPart "Workspace.testVillian.leftEar.primary"  -  Server - Script:4
  16:24:08.325  Stack Begin  -  Studio
  16:24:08.325  Script 'Workspace.testVillian.leftEar.Script', Line 4  -  Studio - Script:4
  16:24:08.325  Stack End  -  Studio

Don’t use “:MoveTo” I don’t think it’s very good, just set the position to whatever.

Something like this:

local model = script.Parent

while wait(1) do
	model.PrimaryPart.Position =, 1, 0)
	model.PrimaryPart.Position =, -1, 0)

The only issue with this is that it doesn’t move smoothly in a linear like way

Sorry I just realised what you need:

local part = workspace.Part -- set this to the part you want to move
local ts = game:GetService("TweenService")
local timeToMove = 1 --you can change this if you like

while wait(timeToMove) do
	local t1 = game:GetService("TweenService"):Create(part,, {Position = part.Position +, 1, 0)})
	local t2 = game:GetService("TweenService"):Create(part,, {Position = part.Position +, -1, 0)})

Assuming that wouldn’t go into a ServerScript inside the part because the GetService

There are two versions of MoveTo, one of them takes in a vector3 position and just sets the primarypart of a model’s position to that vector3(its almost exactly the same as just setting the position directly), the second version is humanoid:MoveTo where it forces the humanoid to move in a certain directly relative to the walkspeed for this however I believe TweenInfo comes in handy

local model = modelPath
game.TweenService:Create(modelPath.PrimaryPart,,Enum.EasingStyle.Sine,Enum.EasingStyle.InOut,math.huge,true,0,{Position =,1,0)}):Play()```
1 Like

If you wish to move a group of parts linearly,

I would once again recommend reading this.

what do you mean? (minimum message size)

Ill explain this tweeninfo has many hidden properties some developers don’t know abbout and here is a list of them
    1, --time it takes for the tween to happen
    Enum.EasingStyle.Sine, --the easing style you can read about the different kinds here
    Enum.EasingDirection.InOut, --Direction of the tween more about it here
    math.huge, --How many times this tween should repeat (math.huge is infinite)
    true, -- whether or not this tween will reverse itself and the tween properties(if true then it will reverse and since the repeat time is infinite itll keep revering over and over like you want)
    0--delay between each tween
1 Like

*like it wouldnt go into a script like this in workspace

i still dont understand. what do you mean “it wouldn’t go into a script”?

like LocalScript or ServerScript

i swear i dont know what the means. are you asking if it goes into a local or server script?
btw it goes in serverscript

TweenService or :GetService can be called on both the server and client, however some services like serverstorage are locked to the server

yes, it is in a ServerScript but thats why I’m wondering.

because im geting this even after i tried local

GetsService is not a valid member of DataModel "Game" - Server - Script:2