Flipping entire folder upside-down, without broken models

Hey all, as you may know i SUCK at math & CFrame, and i need to figure out how to flip a folder upside-down (i could make it a model). The folder contains components of my map. Any ideas? I’ve gotten it to semi-work so far, but my models are broken since all their parts are flipped in weird ways.

Do you mean flipping all the models within a folder upside down?

2 Likes

We can’t really help if you don’t show us the script you are using.
From your description it sounds like you are going through all the models in the folder and then also going through all the Parts in each Model to cause them to flip.
It should be set up like this:

  • go through just the list of Models in the folder.
  • if you want to rotate each model by world space then use World CFrame. If you want to rotate each model by its own PrimaryPart CFrame then do it that way.
1 Like

cc @ReplacedLetter @Scottifly

so sorry for not explaining well enough, what im trying to achieve is;
for example, if you had a model of a map, and you simply rotated it upside-down, thats what i want, but i need to do it in a script

Make the entire map 1 model.
Have a Part at the spot you want it to pivot at. Set that Part as the Model’s PrimaryPart.
Rotate the model 180 degrees using the Orientation Property, or CFrame it.

Did you want it to just flip instantly or just rotate slowly? If you want it done slowly you could tween the Rotation.

2 Likes

thanks, dunno why i didnt think of this. ill try it tomorrow

1 Like

ok so i forgot to mention the model isn’t welded together or anything, and some of it’s components are anchored, im guessing your solution wouldn’t work in this case?

You can rotate the entire model using PivotTo


Incremental pivot (current model orientation + 180)

Model:PivotTo(Model:GetPivot() * CFrame.Angles(0, 0, math.rad(180)))

Precise pivot (Set to the desired orientation no matter of the current one)

Model:PivotTo(CFrame.new(Model:GetPivot().Position) * CFrame.Angles(0, 0, math.rad(180)))

It also work with tween in case you want a smooth rotation

local TweenService = game:GetService("TweenService")

local ValueObject = Instance.new("NumberValue")
ValueObject.Value = Model:GetPivot().Rotation.Z

local ValueTween = TweenService:Create(ValueObject, TweenInfo.new(1, Enum.EasingStyle.Linear), {Value = ValueObject.Value + 180})
local ValueChanged = ValueObject:GetPropertyChangedSignal("Value"):Connect(function()
	Model:PivotTo(CFrame.new(Model:GetPivot().Position) * CFrame.Angles(0, 0, math.rad(ValueObject.Value)))
end)

ValueTween:Play()
ValueTween.Completed:Wait()
ValueChanged:Disconnect()
ValueChanged = nil
1 Like

works like a charm! i did spawn in a different position, but i can sort that out myself. thanks, i thought PivotTo just changed the primarypart specifically

1 Like

I edited my previous reply to include more informations in case you need it, enjoy! :slightly_smiling_face:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.