Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

Custom-rigged Dragon animation doesn't animate, except if anchored?

Asked by 8 years ago

It's difficult to explain. So I'll be using screenshots if that's fine.

Description: I've been making a dragon, fully animated and with a custom rigging. Though, it seems that the first wing being welded to the character displaces. Yet both the wing welding scripts are the same (Except for the Left/Right part) and the rigging is all fine too. Code paths fine as well. The weight is fine as well, because I sized the wings down earlier, and it had no effect.

What I've tried to fix it:

  1. Re-animating the entire rigging. (About 7 times)
  2. Re-rigging it (About 4 - 5 times)
  3. Sizing the wings down. (Followed by a re-animate & re-rigging)
  4. Re-doing/modifying some code
  5. Pasting it in a new place (In the hope it'd work...)
  6. Make the morph weld everything separately. (Walking on one button for each body piece)

All the above did not work. So I was hoping people would know how to fix it here.

What I found out:

  1. The first wing being welded to the character doesn't function correctly.
  2. The parts usually called 'Middle' are misplaced, together with the character's body parts the middles attach to.
  3. When I anchor any character's part, the misplaced objects all return to the right spot and the animation functions correctly. (This works best when anchoring the torso.) But after unchecking the anchor box, they all misplace again.

Screenshots and explanation: The Morph model: http://prntscr.com/9605k1 This is what the character should become. (Unanimated still)

After stepping on the button, the following parts/models are cloned into the character: http://prntscr.com/9605pe http://prntscr.com/9605sz Those will change the appearance of the character.

And this is how it looks when the torso is not anchored: http://prntscr.com/9605vc http://prntscr.com/9605xm

This is how it looks when the torso is anchored: http://prntscr.com/9605zv http://prntscr.com/960625

Some codes related to the issue: The Morphing script:

function onTouched(hit)
    if hit.Parent:findFirstChild("Humanoid") ~= nil and hit.Parent:findFirstChild("RightA1") == nil and hit.Parent:findFirstChild("RightA2") == nil and hit.Parent:findFirstChild("RightA3") == nil and hit.Parent:findFirstChild("LeftA1") == nil and hit.Parent:findFirstChild("LeftA2") == nil and hit.Parent:findFirstChild("LeftA3") == nil then
        -- Right Wings --
        local g = script.Parent.Parent.RightA1:clone()
        g.Parent = hit.Parent
        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 = hit.Parent["Right Arm"]
            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

        local g2 = script.Parent.Parent.RightA2:clone()
        g2.Parent = hit.Parent
        local C = g2:GetChildren()
        for i=1, #C do
            if C[i]:IsA("BasePart") then
                local W = Instance.new("Weld")
                W.Part0 = g2.Middle
                W.Part1 = C[i]
                local CJ = CFrame.new(g2.Middle.Position)
                local C0 = g2.Middle.CFrame:inverse()*CJ
                local C1 = C[i].CFrame:inverse()*CJ
                W.C0 = C0
                W.C1 = C1
                W.Parent = g2.Middle
            end
            local Y = Instance.new("Weld")
            Y.Part0 = hit.Parent["Right Arm 2"]
            Y.Part1 = g2.Middle
            Y.C0 = CFrame.new(0, 0, 0)
            Y.Parent = Y.Part0
        end

        local h = g2:GetChildren()
        for i = 1, # h do
            if h[i]:IsA("BasePart") then
                h[i].Anchored = false
                h[i].CanCollide = false
            end
        end

        local g3 = script.Parent.Parent.RightA3:clone()
        g3.Parent = hit.Parent
        local C = g3:GetChildren()
        for i=1, #C do
            if C[i]:IsA("BasePart") then
                local W = Instance.new("Weld")
                W.Part0 = g3.Middle
                W.Part1 = C[i]
                local CJ = CFrame.new(g3.Middle.Position)
                local C0 = g3.Middle.CFrame:inverse()*CJ
                local C1 = C[i].CFrame:inverse()*CJ
                W.C0 = C0
                W.C1 = C1
                W.Parent = g3.Middle
            end
            local Y = Instance.new("Weld")
            Y.Part0 = hit.Parent["Right Arm 3"]
            Y.Part1 = g3.Middle
            Y.C0 = CFrame.new(0, 0, 0)
            Y.Parent = Y.Part0
        end

        local h = g3:GetChildren()
        for i = 1, # h do
            if h[i]:IsA("BasePart") then
                h[i].Anchored = false
                h[i].CanCollide = false
            end
        end
        -- Left Wings --
        local g4 = script.Parent.Parent.LeftA1:clone()
        g4.Parent = hit.Parent
        local C = g4:GetChildren()
        for i=1, #C do
            if C[i]:IsA("BasePart") then
                local W = Instance.new("Weld")
                W.Part0 = g4.Middle
                W.Part1 = C[i]
                local CJ = CFrame.new(g4.Middle.Position)
                local C0 = g4.Middle.CFrame:inverse()*CJ
                local C1 = C[i].CFrame:inverse()*CJ
                W.C0 = C0
                W.C1 = C1
                W.Parent = g4.Middle
            end
            local Y = Instance.new("Weld")
            Y.Part0 = hit.Parent["Left Arm"]
            Y.Part1 = g4.Middle
            Y.C0 = CFrame.new(0, 0, 0)
            Y.Parent = Y.Part0
        end

        local h = g4:GetChildren()
        for i = 1, # h do
            if h[i]:IsA("BasePart") then
                h[i].Anchored = false
                h[i].CanCollide = false
            end
        end

        local g5 = script.Parent.Parent.LeftA2:clone()
        g5.Parent = hit.Parent
        local C = g5:GetChildren()
        for i=1, #C do
            if C[i]:IsA("BasePart") then
                local W = Instance.new("Weld")
                W.Part0 = g5.Middle
                W.Part1 = C[i]
                local CJ = CFrame.new(g5.Middle.Position)
                local C0 = g5.Middle.CFrame:inverse()*CJ
                local C1 = C[i].CFrame:inverse()*CJ
                W.C0 = C0
                W.C1 = C1
                W.Parent = g5.Middle
            end
            local Y = Instance.new("Weld")
            Y.Part0 = hit.Parent["Left Arm 2"]
            Y.Part1 = g5.Middle
            Y.C0 = CFrame.new(0, 0, 0)
            Y.Parent = Y.Part0
        end

        local h = g5:GetChildren()
        for i = 1, # h do
            if h[i]:IsA("BasePart") then
                h[i].Anchored = false
                h[i].CanCollide = false
            end
        end

        local g6 = script.Parent.Parent.LeftA3:clone()
        g6.Parent = hit.Parent
        local C = g6:GetChildren()
        for i=1, #C do
            if C[i]:IsA("BasePart") then
                local W = Instance.new("Weld")
                W.Part0 = g6.Middle
                W.Part1 = C[i]
                local CJ = CFrame.new(g6.Middle.Position)
                local C0 = g6.Middle.CFrame:inverse()*CJ
                local C1 = C[i].CFrame:inverse()*CJ
                W.C0 = C0
                W.C1 = C1
                W.Parent = g6.Middle
            end
            local Y = Instance.new("Weld")
            Y.Part0 = hit.Parent["Left Arm 3"]
            Y.Part1 = g6.Middle
            Y.C0 = CFrame.new(0, 0, 0)
            Y.Parent = Y.Part0
        end

        local h = g6:GetChildren()
        for i = 1, # h do
            if h[i]:IsA("BasePart") then
                h[i].Anchored = false
                h[i].CanCollide = false
            end
        end
    end
end

script.Parent.Touched:connect(onTouched)
0
Why don't you try using the custom character creator plugin and replacing the character? Chronomad 180 — 8y
0
I've never heard of it. And therefore this all worked on other morphs. Could you introduce it to me, please? (I'll PM you on Roblox or so?) SlopranoDark 0 — 8y

1 answer

Log in to vote
0
Answered by
Hero_ic 502 Moderation Voter
8 years ago

Use Motor6D's with the character creator plugin which you must have a humanoidrootpart that links to every part then the animations should work.

0
I've already got Motor6D's by a different script. Therefore everything works, except for the right- or left wing ... So that should be fine. Have you got any other idea? Thanks for helping so far SlopranoDark 0 — 8y
Ad

Answer this question