Hi. I am making a mirror, and it’s most likely done. Just a bit of help, the problem is with when a player is facing straight, the clone is also facing straight instead of looking at the character and it’s unanimated, too. Here’s how:
Here’s my code:
local Mirror = game.Workspace:WaitForChild("Mirror")
local RunService = game:GetService("RunService");
local Mirror = game.Workspace:WaitForChild("Mirror")
local RunService = game:GetService("RunService");
local function reflect()
for i, v in next, game.Players:GetPlayers() do
if (v) ~= nil then
if (v.Character) ~= nil then
for a, b in next, v.Character:GetDescendants() do
if (b) ~= nil then
if b:IsA("BasePart") or b:IsA("UnionOperation") or b:IsA("MeshPart") then
local objectSpace = Mirror.CFrame:Inverse() * (v.Character:GetPrimaryPartCFrame());
local worldSpace = Mirror.CFrame:ToWorldSpace(CFrame.new(objectSpace.X, objectSpace.Y, -objectSpace.Z) * CFrame.Angles(objectSpace:ToEulerAnglesXYZ()));
v.Character.Archivable = true;
local newCharacter;
if not workspace:FindFirstChild("Dummy") then
newCharacter = v.Character:Clone()
newCharacter.Name = "Dummy"
newCharacter.Parent = workspace;
end
local new = workspace:FindFirstChild("Dummy")
if new then
new:SetPrimaryPartCFrame(worldSpace)
end
end
end
end
end
end;
end;
end;
RunService.RenderStepped:Connect(reflect);
Help is really appreciated: