GSmGpE6CwX2y9JjB25B8
We use cookies on this site to enhance your user experience

R15 Compatibility Guide

R15 Compatibility Guide

Aug 29 2019, 9:22 AM PST

Roblox is working on a major upgrade to the character. Up until 2016, there has only been one type of character, with 6 parts. Now we are introducing a second type of character, R15, that has 15 parts. This article details how you can upgrade your game to support R15 characters, or make your game compatible with both.

R15_R6_SideBySide2.png

What is R15?

“As the name suggests, the new R15 avatar is composed of 15 body parts as opposed to the 6 seen in our previous iteration. The additional joints give your character a more expressive range of motion and improved articulation. Characters will now look more lively and more animated, all while staying true to our traditional blocky aesthetic.” Source: blog.roblox.com

R15 is an optional feature that has to be purposefully enabled by a game creator. Because it changes the parts that compose a character, you will have to do manual work to ensure that your older games are R15 compatible.

What’s new with R15?

Attachments

Roblox introduced a new object type, Attachment. An attachment is an object that specifies a position and a rotation relative to a part. This makes it much easier to calculate how objects should be welded or connected to each other with constraints. Up until now, all hats have been welded to the character’s head. This is bad because you want some accessories to be attached to other parts of the character’s body. For example, you would expect a Ninja Swordpack to be attached to the player’s back.

With the R15 rig, there are numerous attachments so that you can choose a location on the character’s body that you want to attach an object.

See R15 Attachments.

New Parts

The R6 rig has a very limiting range of motion, because it is only made up of 6 parts. For example, it’s difficult to make a realistic looking crouch animation when you can’t bend your knees. The R15 rig fixes this problem by splitting up the character into many more parts.

{|class=“wikitable” style=“width: 100%;”
| style=“vertical-align:top;” |
R6 Character
{{tree|
{{tree/node|Model|Player1|
{{tree/node|Humanoid|Humanoid}}
{{tree/node|BodyColors|Body Colors}}
{{tree/node|Part|HumanoidRootPart}}
{{tree/node|Part|Head|
{{tree/node|Decal|face}}
{{tree/node|SpecialMesh|Mesh}}
}}
{{tree/node|Part|Torso}}
{{tree/node|Part|Left Arm}}
{{tree/node|Part|Right Arm}}
{{tree/node|Part|Left Leg}}
{{tree/node|Part|Right Leg}}
}}
}}
| style=“vertical-align:top;” |
R15 Character
{{tree|
{{tree/node|Model|Player1|

	{{tree/node|Humanoid|Humanoid}}
	{{tree/node|BodyColors|Body Colors}}
	{{tree/node|Part|HumanoidRootPart}}
	{{tree/node|Part|Head|
		{{tree/node|SpecialMesh|Mesh}}
		{{tree/node|Decal|face}}
	}}
	{{tree/node|MeshPart|UpperTorso}}
	{{tree/node|MeshPart|LowerTorso}}
	{{tree/node|MeshPart|LeftUpperArm}}
	{{tree/node|MeshPart|LeftLowerArm}}
	{{tree/node|MeshPart|LeftHand}}
	{{tree/node|MeshPart|RightUpperArm}}
	{{tree/node|MeshPart|RightLowerArm}}
	{{tree/node|MeshPart|RightHand}}
	{{tree/node|MeshPart|LeftUpperLeg}}
	{{tree/node|MeshPart|LeftLowerLeg}}
	{{tree/node|MeshPart|LeftFoot}}
	{{tree/node|MeshPart|RightUpperLeg}}
	{{tree/node|MeshPart|RightLowerLeg}}
	{{tree/node|MeshPart|RightFoot}}
}}

}}
|}

A lot of scripts rely on parts with certain names existing. For example, many gun scripts weld parts to the character’s first child named Right Arm. This works fine for R6, but if you want to adapt your game to work with R15, or work with both R6 and R15, this will require a few tweaks. We’ll cover that later.

Part -> MeshPart

For R15, every part except for the Head and HumanoidRootPart are now MeshParts instead of Parts. MeshParts have all the same properties as Parts do, with the addition of a MeshID that allows for non-block shaped parts. The default R15 rig has a set of meshes that give a “beveled” look to the character.

Currently MeshID is not scriptable, which means you can only change it in Studio, you can’t change the value in a running game. If you want to change the meshes that are associated with an R15 character on the fly, you can either make the existing MeshParts invisible by setting Transparency to 1, and welding a fake part to each limb that you can add Meshes to.

Package Parts

To support R15, the format for body part assets will slightly change.

Instead of being a single CharacterMesh parented to the character’s part with the same name, the new body parts format will have two folders for R6 and R15. For R6, it will remain the same. For R15, the folder will contain a set of MeshParts for that limb, each with its own attachments. When a character spawns those MeshParts are used to construct the character.

{|class=“wikitable” style=“width: 100%;”
| style=“vertical-align:top;” |
Old Format

{{tree|
{{tree/node|CharacterMesh|Left Arm}}
}}

| style=“vertical-align:top;” |
New Format

{{tree|
{{tree/node|Folder|R15|
{{tree/node|MeshPart|LeftHand|
{{tree/node|Attachment|LeftWristRigAttachment}}
{{tree/node|Attachment|LeftGripAttachment}}
}}
{{tree/node|MeshPart|LeftLowerArm|
{{tree/node|Attachment|LeftElbowRigAttachment}}
{{tree/node|Attachment|LeftWristRigAttachment}}
}}
{{tree/node|MeshPart|LeftUpperArm|
{{tree/node|Attachment|LeftShoulderRigAttachment}}
{{tree/node|Attachment|LeftElbowRigAttachment}}
{{tree/node|Attachment|LeftShoulderAttachment}}
}}
}}
{{tree/node|Folder|R6|
{{tree/node|CharacterMesh|Left Arm}}
}}
}}

|}

The following code can be used to apply a package part to a character

local function buildJoint(parentAttachment, partForJointAttachment)
    local jointName = parentAttachment.Name:gsub("RigAttachment", "")
    local motor = partForJointAttachment.Parent:FindFirstChild(jointName)
    if not motor then
        motor = Instance.new("Motor6D")
    end
	motor.Name = jointName

    motor.Part0 = parentAttachment.Parent
    motor.Part1 = partForJointAttachment.Parent
    
	motor.C0 = parentAttachment.CFrame
    motor.C1 = partForJointAttachment.CFrame
	
    motor.Parent = partForJointAttachment.Parent
end

-- Removes old Motor6Ds and builds the rig from the attachments in the parts
-- Call this with nil, HumanoidRootPart
function buildRigFromAttachments(last, part)
	for _, attachment in pairs(part:GetChildren()) do
		if attachment:IsA("Attachment") and string.find(attachment.Name, "RigAttachment") then
			for _, sibling in pairs(part.Parent:GetChildren()) do
				if sibling ~= part and sibling ~= last then
					local matchingAttachment = sibling:FindFirstChild(attachment.Name)
					if matchingAttachment then
						buildJoint(attachment, matchingAttachment)
						-- Continue the recursive tree traversal building joints
						buildRigFromAttachments(part, matchingAttachment.Parent)
					end
				end
			end
		end
	end
end

local function getOldCharacterMesh(character, newCharacterMesh)
    for _, obj in pairs(character:GetChildren()) do
        if obj:IsA("CharacterMesh") and obj.BodyPart == newCharacterMesh.BodyPart then
            return obj
        end 
    end
    return nil
end

-- Will apply a body part given the r15Folder and the r6Folder for that body part.
function applyBodyPart(character, r15Folder, r6Folder)
    local humanoid = character:FindFirstChild("Humanoid")
    if humanoid.RigType == Enum.HumanoidRigType.R15 then
        for _, part in pairs(r15Folder:GetChildren()) do
            local oldPart = character:FindFirstChild(part.Name)
            part:Clone().Parent = character
            oldPart.Name = ""
            oldPart:Destroy()
        end
        -- Rebuild the rig
        -- Note: if applying many body parts at once it is more efficient to call this after applying them all
        buildRigFromAttachments(nil, character.HumanoidRootPart)
    else
        for _, characterMesh in pairs(r6Folder:GetChildren()) do
            local oldCharacterMesh = getOldCharacterMesh(character, characterMesh)
            if oldCharacterMesh then
                oldCharacterMesh:Destroy()
            end
            characterMesh.Parent = character
        end
    end
end

Game Setting

Game creators can choose whether or not to support R15 characters. To access this setting

  • Go to the [//www.roblox.com/develop Develop] page
  • Click on the dropdown menu for the place you want to edit, and click Configure Place
  • Go to the Games tab and click on the link next to “This place is part of the Game:”
    R15Toggle.PNG

You are given three choices

  • Use R6
    ** This is the default choice, and only allows the traditional Roblox character in your place. Any players who have set R15 on their avatar page can still join, but their characters will be forced to be R6 when they spawn.
  • Player Choice
    ** This means you support both R6 and R15 avatars. Players can pick on their avatar page whether they want to be R6 or R15, and that’s what will be chosen for them when they enter the game. This is the best choice because it gives your players the freedom to choose how they look. However, it may mean some more work on your end to ensure that your game supports both types.
  • Use R15
    ** This means your game is only compatible with R15, and all characters will be forced to be R15 when they spawn.

Making Games Compatible With R15

Detecting Avatar Type

If your scripts need to check on the fly whether a player is R15 or R6, the Humanoid object has a RigType property.
Example code:

local touchPart = game.Workspace.TouchPart
touchPart.Touched:connect(function(part)
   local humanoid = part.Parent and part.Parent:FindFirstChild("Humanoid")
   if humanoid then
      if (humanoid.RigType == Enum.HumanoidRigType.R6) then
         print("Humanoid is R6")
      elseif (humanoid.RigType == Enum.HumanoidRigType.R15) then
         print("Humanoid is R15!")
      end
   end
end)

Scripts

If you want to make your game R15 compatible, any scripts that directly reference these parts will have to be fixed, because the parts do not exist in an R15 rig:

  • Right Arm
  • Right Leg
  • Left Arm
  • Left Leg
  • Torso

Fixing Tools

Here are some step-by-step examples of how to convert a tool to work with both R6 and R15. They should give you a general idea of what to look for in order to make tools R15 compatible.

Making old tools work with R15

Animations

Creating new animations

You can animate an R15 rig in the same way that you animate an R6 rig. Insert a model of an R15 character into studio, open the Animation Editor plugin, and click on the R15 model to start creating an animation.

R15 Rig Model

R6 Rig Model

Changes

Update Log

{| class=“wikitable”
! scope=“col” width=“150px” | Date !! Details
|-
| {{* dateformat:2016-08-19|dmy}} || All players are allowed to set whether their games allow R6, R15, or PlayerChoice.
|-
| {{* dateformat:2016-09-26|dmy}} || Toggle for R6/R15 was added to the avatar page which allows users to choose their preferred avatar type.
|}

The R15 Avatar is Here

The Future of the Roblox Avatar

See Also