Hi there,
I was wondering if it was possible to connect (weld?) a filemesh to your character, and if so, how you would go about doing this. Just in case the question is unclear, I will give an example.
So let's say I have a 3D model of a backpack I made in another program. I would like to attach that backpack to a player's character. However, I'm not sure how I should do this (should I use a weld? Make the backpack a tool?). I already have a filemesh uploaded in Roblox Studio, so please do not explain how to upload a filemesh.
Any suggestions would be much appreciated! If you need any further explanation, feel free to comment.
I believe that the best option would be to have a block the size of the characters Torso that is welded to the backpack, and gets welded to the players Torso when they spawn or however you choose to do it.
Here is a script I made about a year ago to attach blocks to player's characters:
function Torso(char) local g = game.ServerStorage.Backpack:Clone(); g.Parent = char; local C = g:GetChildren(); for i=1, #C do if C[i]:IsA("BasePart")then local W = Instance.new("Weld"); W.Part0 = g.Middle; W.Part1 = C[i]; local CJ = CFrame.new(g.Middle.Position); local C0 = g.Middle.CFrame:inverse()*CJ; local C1 = C[i].CFrame:inverse()*CJ; W.C0 = C0; W.C1 = C1; W.Parent = g.Middle; end; local Y = Instance.new("Weld"); Y.Part0 = char:FindFirstChild("Torso"); Y.Part1 = g.Middle; Y.C0 = CFrame.new(0, 0, 0); Y.Parent = Y.Part0; end; local h = g:GetChildren(); for i = 1, # h do if h[i]:IsA("BasePart") then h[i].Anchored = false; h[i].CanCollide = false; end; end; end; game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) wait(2); Torso(char); end); end);
This code will move the model based on the piece called Middle (Note: This piece is the one that is the size of the Torso). I hope this helped. If it did please accept this as the answer so that people know it has been solved.