I’ve seen a couple games manage to pull off a semi-realistic mirror through cloning characters. But i’m confused on how to properly match the location and orientation, along with the animation in the mirror.
I tried writing this:
wait(3)
while true do
wait()
players = game.Players:GetChildren()
for i=1, #players do
local ccc = players[i].Character
players[i].Character.Archivable = true
newww = ccc:Clone()
newww.Parent = workspace
newww.HumanoidRootPart.CFrame = script.Parent.CFrame + (script.Parent.Position -ccc.HumanoidRootPart.Position)
wait()
newww:Remove()
end
end
But it just leaves a flashing, unanimated, unrotated, character on the other side of the mirror. It also places the character on the opposite side horizontally.
Your characters are flashing because you use :Remove()/:Destroy() every time you update the scene.
To achieve this, you need to clone the entire character’s model, remove all of the scripts within, destroy all joints, change the model’s name to an empty string and make every single part anchored. Then you need to orientate the part exactly on the opposite side of the mirror’s plane.
I use the code linked here: https://wiki.unity3d.com/index.php/MirrorReflection3
It’s for Unity, so no Lua, but the only component of it you need to achieve this is “CalculateReflectionMatrix” at the very end.