This is a pretty dumb issue, but how would I go about moving multiple parts at once in a script. I have tried parenting and weld constraints, but nothing is working. Any help is appreciated!
You can probably group all parts or place them in a folder and then you can do a for _, Parts in pairs(Folder:GetChildren()) do
script.
Is there no simpler way? I find it hard to believe complex models are moved that way.
In my own knowledge, I don’t really know.
If all the parts are in a model, set a BasePart and use Model:PivotTo(CFrame)
.
Else, you’ll have to loop through the parts and move them a set distance, or to a set position using math, which should just be getting an offset from a point, and applying it to a new position.
It’s easy. Group the parts together, and then use Model:PivotTo
.
If you mean to be using tweens, just have one part be affected by the tween, and the rest of the parts welded to said part that gets tweened, make sure the parts that get welded are unanchored.
A few questions:
How do you want them moved?
- straight line?
- fly around like a plane?
- in a pattern like a train?
How many Parts?
- do you need them Anchored? If so you can Unanchor them and weld them to a main Part. The main part can be Anchored and tweened or CFramed like @DurinzTheThird_2 said.
- If they’re all Unanchored you can weld them together and you can move it with Constraint forces, or you can use MoveTo or PivotTo like @SubtotalAnt8185 said.
The model is being controlled with a script that sets it’s position based on a lerp.
Yeah, but that isn’t what I asked.
The reason I asked those questions is to understand the reason you are trying to move these multiple Parts. Your answers can let someone know the specifics of your particular issue and instead of saying ‘Try this or try this or maybe try this’ they can say ‘This way is the best possible way to solve your problem’.
Some of the determining factors that will help us help you:
- Do you have players walking on these moving models?
- Is the item moving just in a straight line or around a track like a train, or does it move in a 2D pattern like a car or boat, or 3D like a plane, spaceship, or a submarine?
- Does the Model need to be Anchored or Unanchored? (as I asked above).
Since you are asking for help with scripting you should post your script so we can understand how you are doing it.
Remember to copy/paste it here with 3 backticks before and after (```) so it formats properly.
Ah, sorry. The models will not interact with the world. They will be following the player and will not move in a pattern, and are anchored.
Ah, ok, that’s a better description.
Sounds like you want something like pets that follow the player.
Try using the term ‘pets that follow’ in the Search tool up top. You may find answers in those posts that help you out.
Thanks for the help, I just discovered PivotTo
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.