Can I animate joints?

I believe the title is very clear. Can I animate joints? If not, then what should I do? Should I create parts like joints?

1 Like

Are you asking if you can animate a character (to do things like dances, emotes, etc.)? If so, then yes, you can, as long as your character is rigged correctly.

There are tutorials on the forum on how to rig that can help you so you can animate your rigs:

1 Like

I know we can rig custom characters and animate them. However, I want a Machine Learning model to generate a realistic animation. Can I make something like a joint system? (e.g you move one joint and one part of the body moves a little bit)

If I’m understanding correctly, you want to move joints through a script? If so, that is possible! It still requires you to rig a character, but, again, if rigged properly,

local Character = your.Path.To.Character
local HumanoidRootPart = Character.HumanoidRootPart
local JointYouWantToMove = Character:FindFirstChild("JointName", true) -- you might have to change "FindFirstChild" to "WaitForChild" or just Character.JointName; it depends on how the machine is being loaded in

function MoveJoint(joint)
    if joint then
        joint.C0 = CFrame.new(Your,CFrame,Here) -- C0 determines how the offset point is attached to JointInstance.Part0.
    end
end

Here’s an API documentation as well for Motor6Ds:

Also, here's an example of joint manipulation through script other than my placebo code for you
local camera = workspace.CurrentCamera

local character = game.Players.LocalPlayer.Character
local root = character:WaitForChild("HumanoidRootPart")
local neck = character:FindFirstChild("Neck", true)

game:GetService("RunService").RenderedStepped:Connect(function()
    local cameraDirection = root.CFrame:toObjectSpace(camera.CFrame).lookVector

    if neck then
        neck.C0 = CFrame.new(0, yOffset, 0) * CFrame.Angles(0, -math.asin(cameraDirection.x), 0) * CFrame.Angles(math.asin(cameraDirection.y), 0, 0)
    end
end)

This rotates the head according to the rotation of the player’s camera (only works for R15 characters) using the same joint manipulation that I used in the placebo code.

Not sure what you want machine learning for exactly, but you are basically describing IK - a feature already present in the Roblox animation editor. Turn it on for your rig and you can move the entire body by just dragging the hands or feet.

I’m trying to do some stuff with the Inverse Kinematics, actually

Edit: Also I want to use the machine learning to try to generate some targets for a realistic animation

Are the joints going to be Motor6Ds?

Yes, they are going to be Motor6Ds, just like they are in a custom character. If you want, you can use a plugin like RigEdit to make your life easier when it comes to rigging.

Could I rig the players normal outfit when they join? Or will I need to give them some custom characters they need to choose from?

Edit: Checked the rigedit page you sent, does the part move with the joint?

If you want to move the player’s joint, you can just call the player’s joint through a script like this:

-- Script inside StarterCharacterScripts
local Character = script.Parent
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
local JointYouWantToMove = Character:FindFirstChild("JointName", true) -- you might have to change "FindFirstChild" to "WaitForChild" or just Character.JointName; it depends on how the machine is being loaded in

No I mean, do I need to rig their outfits or add joints when they join?

I’m slightly confused…are you trying to animate the player or something else?

Okay, let me restart. So I want to make an ML model that generates targets for my animation script to animate to(yes, not original). I want it to be somewhat realistic, so I was thinking of animating joints and the parts going with them. Is there a better option to do this? If not, how could I do this?