i made the camera get the inverted pos relative to the mirror which obviously isn’t the brightest idea
Script so far
game:GetService("RunService").RenderStepped:Connect(function()
local CameraP = CurrentCamera.CFrame.p
local Point = CFrame.new(Mirror.CFrame:PointToWorldSpace(-Mirror.CFrame:PointToObjectSpace(CurrentCamera.CFrame.Position)), CurrentCamera.CFrame.Position)
-- local Test = Instance.new("Part",workspace)
-- Test.Size = Vector3.new(1,1,1)
-- Test.CFrame = Point
-- Test.Anchored = true
-- Test.CanCollide = false
MirrorCamera.CFrame = Point
end)
i do understand that there are more efficient ways to make mirrors im just trying to take the challenge and make a working viewport frame mirror because if i do make one it’s going to quickly take over most of the games on Roblox
The main issue is that the image isn’t horizontally flipped. Not sure how best to fix that other than to flip every part that you’ve got in the mirrored version.
Second issue is that you only want to flip the camera through the mirror. The up-down angle is being flipped too which is why the horizon moves incorrectly in the mirror and why you see sky in the mirror when you point the camera down in the real world. Upon review I think the problem is actually much worse, your camera rotation isn’t defined at all, it’s using subject which is why the character always stays in the middle of the mirror. If you make the mirror camera focus on the character as the subject, it will always be wrong. You need to base the mirror camera angle on your real camera angle with the orientation around Y axis flipped through the plane of the mirror.
Think of a real life mirror, when you walk to the side your reflection doesn’t stay in the middle.