You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want to copy the player character’s pose every frame and apply it to a separate rig. -
What is the issue? Include screenshots / videos if possible!
Doing this via CFraming causes the rig to do this:
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried to set the Transforms for the Motor6Ds in the rig to the Transforms for the corresponding Motor6Ds in the player character like in this post, but it did not do anything at all. The rig would stay completely still, and there were no errors in console.
Pic of what happens when the Transform code below is used:
Code I used for CFrame:
local RunS = game:GetService("RunService")
RunS.Heartbeat:Connect(function()
for _,part in ipairs(clone:GetChildren()) do
if part:IsA("BasePart") and player.Character:FindFirstChild(part.Name) then
part.CFrame = player.Character[part.Name].CFrame
end
end
end)
Code I used for Transform (crappy but i havent really looked into better ways of finding the motor6ds):
local RunS = game:GetService("RunService")
RunS.Heartbeat:Connect(function()
for _,part in ipairs(clone:GetChildren()) do
local m6d1 = part:FindFirstChildWhichIsA("Motor6D")
if m6d1 then
for _,plrPart in ipairs(player.Character:GetChildren()) do
local m6d2 = plrPart:FindFirstChildWhichIsA("Motor6D")
if m6d2 and m6d2.Name == m6d1.Name then
m6d1.Transform = m6d2.Transform
end
end
end
end
end)
Please tell me if there’s an issue with the code itself, or if there’s other ways of achieving what I want. Thank you.