How do i mirror a cframe?

I made this post before but I couldn’t find a solution, so i’m gonna ask again.

I just want to know how to take one cframe of a part and reverse it in the opposite direction like a mirror.

I’m not 100% sure what you mean, but here is a script that could in theory mirror it.*

local part = nil -- change this to your part
local clone  = part:Clone()

clone.CFrame = (part.CFrame + CFrame.new(part.Size,0,0,0) -- this will mirror it on the X
clone.Rotation += 180

-- im not sure how to mirror based on facing of the part :/

I’m not sure if this will work since I am not on Roblox Studio right now.

*If the thing you are talking about is a Model you would need to set the PrimaryPart’s CFrame instead.

You can do something like this to mirror a part:

local part = nil -- your part
local clonedPart = part:Clone()
-- -8 is how far its from the original part
clonedPart.CFrame *= CFrame.new(0, 0, -8) * CFrame.Angles(math.rad(180), 0, 0)
clonedPart.Parent = workspace

Not sure if this helps but…

local Part = script.Parent.Part
Part.CFrame = Part.CFrame:Inverse()

I also found these 2 post that might be of similar interest.
1.

2.

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