Welcome to the Forums!
Join thousands of other Roblox members with a free account.
Create Forum Account

Custom 3D armor (Help)

  • This website was created by Roblox members to replace the official forums (because Roblox shut them down) Join us if you like Roblox!

Koira

Member
Reputation: 0 / 0 / 0
Sep 26, 2020
43
22
8
Roblox
Taacoo
Discord
Koira#4378
Hello,

I'm not sure whether to put this under building or scripting so I put it here...

Basically, I've worked on a custom 3D armor today and I know how to import it to roblox. What I don't know, however, is how to make it wearable...Help?ArmourFront.JPGFront
ArmourBack.JPGBack

Also suggestions/thoughts about the armour itself is appreciated.
 

CallMeKY

Moderator
Ultra
Reputation: 5 / 0 / 0
Feb 25, 2018
1,392
16
502
113
Maine, USA
Roblox
CallMeKY
Discord
CallMeKY#5012
Hello,

I'm not sure whether to put this under building or scripting so I put it here...

Basically, I've worked on a custom 3D armor today and I know how to import it to roblox. What I don't know, however, is how to make it wearable...Help?View attachment 28127Front
View attachment 28128Back

Also suggestions/thoughts about the armour itself is appreciated.
You'll need to weld it to the character model. You'll want to read up on CFrames and CFrame Math Operations and play around with those a bit first. In the latter there's even a section specifically about welds, but definitely read the former first or it'll probably be pretty confusing if you don't have experience with it.
 

Koira

Member
Reputation: 0 / 0 / 0
Sep 26, 2020
43
22
8
Roblox
Taacoo
Discord
Koira#4378
Hello,

I'm not sure whether to put this under building or scripting so I put it here...

Basically, I've worked on a custom 3D armor today and I know how to import it to roblox. What I don't know, however, is how to make it wearable...Help?View attachment 28127Front
View attachment 28128Back

Also suggestions/thoughts about the armour itself is appreciated.
You'll need to weld it to the character model. You'll want to read up on CFrames and CFrame Math Operations and play around with those a bit first. In the latter there's even a section specifically about welds, but definitely read the former first or it'll probably be pretty confusing if you don't have experience with it.
Thank's a lot! I'll give that a try! :)
Post automatically merged:

weld it to the startercharacter
Thanks!
Post automatically merged:

You can make a hat that has a specific offset so that it looks like it's in place.
Thanks!
 

CallMeKY

Moderator
Ultra
Reputation: 5 / 0 / 0
Feb 25, 2018
1,392
16
502
113
Maine, USA
Roblox
CallMeKY
Discord
CallMeKY#5012
weld it to the startercharacter


This is definitely the easiest option in the case of only needing the one armor set, but if they do need more they'll need scripting either for replacing armor or changing the starter character and respawning the character.

I wrote up a module to show an example of one way to do this with the option of changing out armor on the fly. In this example you'd have a part that would be invisible called "WeldPart", which every part of each section is welded to, which is then in turn welded to its respective body part. The names of the sections just need to match the name of the body part, and something like this could work for R6 or R15.

Lua:
local armorModule = {}

local armorFolder = game:GetService('ServerStorage'):WaitForChild('Armor')

function armorModule:equipArmor(character, armorName)
    
    -- variables and checks
    local human = character:FindFirstChildOfClass('Humanoid')
    local hrp = character:FindFirstChild('HumanoidRootPart')
    local armor = armorFolder:FindFirstChild(armorName)
    if not human or not hrp or not armor or character:FindFirstChild(armorName) then return end
    armor = armor:Clone()
    
    -- remove any existing armor
    for _, v in pairs(armorFolder:GetChildren()) do
        if character:FindFirstChild(tostring(v)) then
            character[tostring(v)]:Destroy()
        end
    end
    
    -- start equipping armor pieces
    armor.Parent = character
    for _, section in pairs(armor:GetChildren()) do
        local weldPart = section:FindFirstChild('WeldPart')
        weldPart.Transparency = 1
        weldPart.CanCollide = false
        
        -- make sure each piece is welded to WeldPart (so it doesn't fall apart)
        for _, piece in pairs(section:GetChildren()) do
            if piece:IsA('BasePart') and piece ~= weldPart and not piece:FindFirstChildOfClass('Weld') then
                local weld = Instance.new('Weld', piece)
                weld.Part0 = weldPart
                weld.Part1 = piece
                piece.Anchored = false
                piece.CanCollide = false
            end
        end
        
        -- weld each WeldPart to its respective body part and unanchor
        weldPart.Anchored = false
        local bodyPart = character:FindFirstChild(tostring(section))
        local weld = Instance.new('Weld', weldPart)
        weld.Part0 = weldPart
        weld.Part1 = bodyPart
        weld.C0 = weldPart.CFrame:inverse() * weldPart.CFrame
        weld.C1 = bodyPart.CFrame:inverse() * weldPart.CFrame
        
    end
end

return armorModule
 

Koira

Member
Reputation: 0 / 0 / 0
Sep 26, 2020
43
22
8
Roblox
Taacoo
Discord
Koira#4378
weld it to the startercharacter


This is definitely the easiest option in the case of only needing the one armor set, but if they do need more they'll need scripting either for replacing armor or changing the starter character and respawning the character.

I wrote up a module to show an example of one way to do this with the option of changing out armor on the fly. In this example you'd have a part that would be invisible called "WeldPart", which every part of each section is welded to, which is then in turn welded to its respective body part. The names of the sections just need to match the name of the body part, and something like this could work for R6 or R15.

Lua:
local armorModule = {}

local armorFolder = game:GetService('ServerStorage'):WaitForChild('Armor')

function armorModule:equipArmor(character, armorName)
   
    -- variables and checks
    local human = character:FindFirstChildOfClass('Humanoid')
    local hrp = character:FindFirstChild('HumanoidRootPart')
    local armor = armorFolder:FindFirstChild(armorName)
    if not human or not hrp or not armor or character:FindFirstChild(armorName) then return end
    armor = armor:Clone()
   
    -- remove any existing armor
    for _, v in pairs(armorFolder:GetChildren()) do
        if character:FindFirstChild(tostring(v)) then
            character[tostring(v)]:Destroy()
        end
    end
   
    -- start equipping armor pieces
    armor.Parent = character
    for _, section in pairs(armor:GetChildren()) do
        local weldPart = section:FindFirstChild('WeldPart')
        weldPart.Transparency = 1
        weldPart.CanCollide = false
       
        -- make sure each piece is welded to WeldPart (so it doesn't fall apart)
        for _, piece in pairs(section:GetChildren()) do
            if piece:IsA('BasePart') and piece ~= weldPart and not piece:FindFirstChildOfClass('Weld') then
                local weld = Instance.new('Weld', piece)
                weld.Part0 = weldPart
                weld.Part1 = piece
                piece.Anchored = false
                piece.CanCollide = false
            end
        end
       
        -- weld each WeldPart to its respective body part and unanchor
        weldPart.Anchored = false
        local bodyPart = character:FindFirstChild(tostring(section))
        local weld = Instance.new('Weld', weldPart)
        weld.Part0 = weldPart
        weld.Part1 = bodyPart
        weld.C0 = weldPart.CFrame:inverse() * weldPart.CFrame
        weld.C1 = bodyPart.CFrame:inverse() * weldPart.CFrame
       
    end
end

return armorModule
Woah thank you! That is super helpful! Very kind of you and highly appreciated! :D
 
  • Like
Reactions: Burger