[Solved] Why aren't animations replicating with my custom character?
Asked by
5 years ago Edited 5 years ago
Hi, so I'm trying to make something that allows someone to have an r6 hitbox, while keeping their R15 appearance and animations. To do this, I've made their character R6, made them invisible, made a copy of what their actual R15 character should look like, welded their root parts together, and put the R15 rig inside of their character (as a child), and finally I modified the animation script so it would play the animations on the fake r15 character instead. The modified animation script is too long to post here, but the server-side script isn't too long.
01 | local function newchar(plr) |
02 | local uid = plr.UserId |
03 | local charinfo = game:GetService( "Players" ):GetCharacterAppearanceInfoAsync(uid) |
04 | local avatartype = charinfo.playerAvatarType |
06 | if avatartype = = "R6" then |
08 | if not plr.Character then |
09 | plr.CharacterAdded:Wait() |
12 | connection = plr.Character:WaitForChild( "Humanoid" ).Died:Connect( function () |
13 | connection:Disconnect() |
16 | elseif avatartype = = "R15" then |
17 | local char = game:GetService( "ServerStorage" ).CustomChar:Clone() |
19 | char.Parent = workspace |
21 | local humdesc = game:GetService( "Players" ):GetHumanoidDescriptionFromUserId(uid) |
23 | plr:ClearCharacterAppearance() |
24 | for i,v in pairs (char:GetChildren()) do |
27 | for i 2 ,v 2 in pairs (v:GetChildren()) do |
28 | if v 2 :IsA( "BlockMesh" ) or v 2 :IsA( "SpecialMesh" ) then |
33 | Instance.new( "SpecialMesh" , v).Scale = Vector 3. new( 0 , 0 , 0 ) |
35 | char.Head.Transparency = 1 |
38 | local fchar = game:GetService( "ServerStorage" ).R 15 :Clone() |
40 | fchar.Parent = game:GetService( "ServerStorage" ).Temp |
41 | fchar.Humanoid:ApplyDescription(humdesc) |
42 | for i,v in pairs (fchar:GetChildren()) do |
43 | if v:IsA( "BasePart" ) then |
44 | game:GetService( "PhysicsService" ):SetPartCollisionGroup(v, "NonCollidable" ) |
47 | fchar.Humanoid.PlatformStand = true |
49 | local weld = Instance.new( "Weld" ) |
50 | weld.Part 0 = char.HumanoidRootPart |
51 | weld.Part 1 = char [ plr.Name ] .HumanoidRootPart |
52 | weld.C 0 = CFrame.new( 0 ,char [ plr.Name ] .Humanoid.HipHeight- 2 , 0 ) |
53 | weld.Parent = char.HumanoidRootPart |
55 | connection = char.Humanoid.Died:Connect( function () |
56 | connection:Disconnect() |
59 | for i,v in pairs (fchar:GetChildren()) do |
60 | if v:IsA( "BasePart" ) then |
61 | v:SetNetworkOwner(plr) |
66 | game:GetService( "Players" ).PlayerAdded:Connect(newchar) |
the place is here by the way (it's uncopylocked so you can view it in studio).
oh also I'm just looking for any suggestions on what I could try in order to fix it.
Thanks