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 fix the legs on the R6 idle animation. - What is the issue? Include screenshots / videos if possible!
The legs are behaving a bit weird on the R6 idle animation. It’s a small issue, yeah, but I’m trying to find a fix to it because when someone is idle, it looks like they’re floating a bit sometimes. - What solutions have you tried so far? Did you look for solutions on the Creator Hub?
I searched up my exact issue but I couldn’t find anyone else having the issue. The R6 idle animation I’m using is the default one on every R6 rig you create through the “Rig Builder”.
Hello everyone, I am infact making a game which immediately destroys your Roblox Avatar and replaces it with a custom rig (instead of the “StarterCharacter” solution), because my rig is created through code. I have a function called “r6()”, and all it does, is that it creates a R6 rig through a table (the table can contain accessories, because my game does not use your Roblox Avatar, instead it makes your own one which you can decorate and other stuff)
My issue with this is, the R6 legs are acting a bit weird on the idle animation. I can see this difference when I create a R6 rig through the Rig Builder in Studio instead of my custom Rig, where the legs are in place in the idle animation.
I have tried to copy the exact Motor6D CFrames, the exact Attachment CFrames, etc., but it’s still doing the same issue. My “Animate” script is (basically) the same as Roblox’s “Animate” script (I only removed the empty lines so the code is a tiny tiny bit shorter)
I hope that it doesn’t matter that the PrimaryPart of my Rig is the HumanoidRootPart instead of the Head.
Here’s the “r6()” function:
local r6 = function(ch)
if (typeof(ch) ~= "table") then ch = {}; end;
local m = Instance.new("Model");
local h = Instance.new("Humanoid", m);
h.BreakJointsOnDeath = false;
local pt = {};
local d = nil;
-- create Bricks
for i, v in pairs({"Head", "HumanoidRootPart", "Torso", "Left Arm", "Right Arm", "Left Leg", "Right Leg"}) do
if (typeof(v) == "string") then
local p = Instance.new("Part", m);
p.Name = v;
p.Anchored = false;
if (v == "Head") then
p.Size = Vector3.new(2, 1, 1);
local m = Instance.new("SpecialMesh", p);
m.MeshType = Enum.MeshType.Head;
m.Scale = Vector3.new(1.25, 1.25, 1.25);
local f = Instance.new("Decal", p);
f.Name = "face";
f.Face = Enum.NormalId.Front;
f.Texture = "rbxasset://textures/face.png";
elseif (v == "Torso" or v == "HumanoidRootPart") then
p.Size = Vector3.new(2, 2, 1);
if (v == "HumanoidRootPart") then p.Transparency = 1; p.CanCollide = false;
elseif (v == "Torso") then
d = Instance.new("Decal", p);
d.Name = "roblox";
end;
elseif (v == "Left Arm" or v == "Right Arm" or v == "Left Leg" or v == "Right Leg") then
p.Size = Vector3.new(1, 2, 1);
p.CanCollide = false;
end;
pt[v] = p;
end;
end;
local t = pt.Torso;
local hr = pt.HumanoidRootPart;
if (typeof(hr) == "Instance" and hr.ClassName == "Part") then
m.PrimaryPart = hr;
if (typeof(t) == "Instance" and t.ClassName == "Part") then
-- create the RootJoint Motor6D
local rj = Instance.new("Motor6D", hr);
rj.Part0 = hr;
rj.Part1 = t;
rj.C0 = CFrame.new(0, 0, 0) * CFrame.fromEulerAngles(math.rad(-90), math.rad(180), 0);
rj.C1 = CFrame.new(0, 0, 0) * CFrame.fromEulerAngles(math.rad(-90), math.rad(180), 0);
rj.MaxVelocity = .1;
rj.Name = "RootJoint";
end;
end;
if (typeof(t) == "Instance" and t.ClassName == "Part") then
-- coloring the Bodyparts of the R6 rig
local bc = {({20, 21, 25, 28, 116, 121, 124})[ch.tc], 334, 334, 334, 23, 23};
t.BrickColor = BrickColor.new(bc[1]);
pt.Head.BrickColor = BrickColor.new(bc[2]);
pt["Left Arm"].BrickColor = BrickColor.new(bc[3]);
pt["Right Arm"].BrickColor = BrickColor.new(bc[4]);
pt["Left Leg"].BrickColor = BrickColor.new(bc[5]);
pt["Right Leg"].BrickColor = BrickColor.new(bc[6]);
-- creating the Motor6Ds
local n = Instance.new("Motor6D", t);
n.Part0 = t;
n.Part1 = pt.Head;
n.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAngles(math.rad(-90), math.rad(180), 0);
n.C1 = CFrame.new(0, -.5, 0) * CFrame.fromEulerAngles(math.rad(-90), math.rad(180), 0);
n.MaxVelocity = .1;
n.Name = "Neck";
local ls = Instance.new("Motor6D", t);
ls.Part0 = t;
ls.Part1 = pt["Left Arm"];
ls.C0 = CFrame.new(-1, .5, 0) * CFrame.fromEulerAngles(0, math.rad(-90), 0);
ls.C1 = CFrame.new(.5, .5, 0) * CFrame.fromEulerAngles(0, math.rad(-90), 0);
ls.MaxVelocity = .1;
ls.Name = "Left Shoulder";
local rs = Instance.new("Motor6D", t);
rs.Part0 = t;
rs.Part1 = pt["Right Arm"];
rs.C0 = CFrame.new(1, .5, 0) * CFrame.fromEulerAngles(0, math.rad(90), 0);
rs.C1 = CFrame.new(-.5, .5, 0) * CFrame.fromEulerAngles(0, math.rad(90), 0);
rs.MaxVelocity = .1;
rs.Name = "Right Shoulder";
local lh = Instance.new("Motor6D", t);
lh.Part0 = t;
lh.Part1 = pt["Left Leg"];
lh.C0 = CFrame.new(-1, -1, 0) * CFrame.fromEulerAngles(0, math.rad(-90), 0);
lh.C1 = CFrame.new(-.5, 1, 0) * CFrame.fromEulerAngles(0, math.rad(-90), 0);
lh.MaxVelocity = .1;
lh.Name = "Left Hip";
local rh = Instance.new("Motor6D", t);
rh.Part0 = t;
rh.Part1 = pt["Right Leg"];
rh.C0 = CFrame.new(1, -1, 0) * CFrame.fromEulerAngles(0, math.rad(90), 0);
rh.C1 = CFrame.new(.5, 1, 0) * CFrame.fromEulerAngles(0, math.rad(90), 0);
rh.MaxVelocity = .1;
rh.Name = "Right Hip";
local w = Instance.new("Weld", t);
w.C0 = CFrame.new(0, -.7, 0);
w.C1 = CFrame.new(0, .8, 0);
w.Part0 = pt.Head;
w.Part1 = t;
w.Name = "v2_w";
if (typeof(ch.ac) == "table") then
local at = {};
for _, i in pairs(ch.ac) do
if (at[i] ~= true) then
at[i] = true;
for v, _ in pairs(ac_l) do
if (typeof(v) == "Instance" and v.Name == i and (v.ClassName == "Accessory" or v.ClassName == "Tool")) then
v = v:Clone();
v.Parent = m;
break;
end;
end;
end;
end;
at = nil;
end;
end;
do
-- create Attachments
for i, t in pairs({
["Head"] = {
["FaceCenterAttachment"] = CFrame.new(0, 0, 0),
["FaceFrontAttachment"] = CFrame.new(0, 0, -.6),
["HairAttachment"] = CFrame.new(0, .6, 0),
["HatAttachment"] = CFrame.new(0, .6, 0)
},
["HumanoidRootPart"] = {
["RootAttachment"] = CFrame.new(0, 0, 0)
},
["Torso"] = {
["BodyBackAttachment"] = CFrame.new(0, 0, .5),
["BodyFrontAttachment"] = CFrame.new(0, 0, -.5),
["LeftCollarAttachment"] = CFrame.new(-1, 1, 0),
["NeckAttachment"] = CFrame.new(0, 1, 0),
["RightCollarAttachment"] = CFrame.new(1, 1, 0),
["WaistBackAttachment"] = CFrame.new(0, -1, .5),
["WaistCenterAttachment"] = CFrame.new(0, -1, 0),
["WaistFrontAttachment"] = CFrame.new(0, -1, -.5)
},
["Left Arm"] = {
["LeftGripAttachment"] = CFrame.new(0, -1, 0),
["LeftShoulderAttachment"] = CFrame.new(0, 1, 0)
},
["Right Arm"] = {
["RightGripAttachment"] = CFrame.new(0, -1, 0),
["RightShoulderAttachment"] = CFrame.new(0, 1, 0)
},
["Left Leg"] = {
["LeftFootAttachment"] = CFrame.new(0, -1, 0)
},
["Right Leg"] = {
["RightFootAttachment"] = CFrame.new(0, -1, 0)
}
}) do
local p = pt[i];
if (typeof(p) == "Instance" and typeof(t) == "table") then
for i, c in pairs(t) do
if (typeof(c) == "CFrame") then
local v = Instance.new("Attachment", p);
v.Name = i;
v.CFrame = c;
end;
end;
end;
end;
end;
-- make animations visible for everyone on the Server
Instance.new("Animator", h);
return m;
end;
I know it sounds a bit silly that my issue is just the R6 legs animating incorrectly, but it does look a bit weird, and I would like to know the issue of it, because I can’t find it by myself.
Here’s a video of it happening in my game:
Here’s a video of the R6 legs on the idle animation in a different Roblox game:
Thank you for reading to the end of my post.
I hope anyone can help me with this tiny issue. I believe the issue is, that I’m creating the Rig through code, but I want the Server to make sure that the Roblox Avatar is 100% being deleted, and if Roblox ever does a change to the R6 rig, that my game won’t be affected by that change, because it’s hardcoded to create a custom rig.