I’m trying to make a simple mirror, and so I need to find the rotated orientation.
I’ll show you what I mean.
So say I have this red part, that’s reflected through the mirror.
I can’t just rotate everything by 180 degrees
to get the rotation you should be able to just times it by -1 and to get positions just get position of the mirror and object and get the offset by mirror.Position - object.Position and subtract the offset with the X or Z
If we have a given direction vector (in this case, the LookVector of the part) and the plane normal of the mirror then we can calculate a reflected vector.
Our plane normal in this case, will be the LookVector of the semi transparent part you showed in the image. To get the reflected vector, first we need to dot the plane normal and part LookVector. local dot = part.CFrame.LookVector:Dot(planeNormal)
Then, we can solve for the final vector by doing local reflected = 2 * dot * planeNormal - part.CFrame.LookVector
To construct the final part cframe, we can just get the positional offset by doing local positionalOffset = part.CFrame:PointToObjectSpace(mirrorPosition)
then make the cframe like so: local reflectedCFrame = CFrame.new(positionalOffset) * CFrame.lookAt(Vector3.new(), reflected)
NOTE: I haven’t tested this code so please reply with any issues!