#Multiple Morphs cause player to fall

1 messages · Page 1 of 1 (latest)

autumn abyss
#
    local character = player.Character or player.CharacterAdded:Wait()
    if not character then print ("No character") return end
    
    charNames[player] = character.Name

    local characters = game.ReplicatedStorage.Assets.Characters
    local selectedChar = characters:FindFirstChild(modelName)
    if not selectedChar then print ("No selected char") return end

    local clone = selectedChar:Clone()
    
    for _, scrp in ipairs (character:GetChildren()) do
        if scrp:IsA("Script") or scrp:IsA("LocalScript") or scrp:IsA("Humanoid") then
            scrp.Parent = clone
        end
    end

    local cloneHRP = clone:FindFirstChild("HumanoidRootPart")
    local charHRP = character:FindFirstChild("HumanoidRootPart")
    
    clone.Name = player.Name
    player.Character = clone
    
    if cloneHRP and charHRP then
        cloneHRP.CFrame = charHRP.CFrame
    else
        wait("Missing HRP")
    end
    
    clone.Parent = workspace
    character.Parent = game.ReplicatedStorage.Assets.TrueCharacters
    print ("Completed morph")
end

function module:ReturnMorph(player : Player)
    local charName = charNames[player]
    local oldChar = game.ReplicatedStorage.Assets.TrueCharacters:FindFirstChild(charName)
    
    if oldChar then
        
        local currenChar = player.Character
        
        for _, scrp in ipairs (currenChar:GetChildren()) do
            if scrp:IsA("Script") or scrp:IsA("LocalScript") or scrp:IsA("Humanoid") then
                scrp.Parent = oldChar
            end
        end
        
        local newHRP = currenChar:FindFirstChild("HumanoidRootPart")
        local oldHRP = oldChar:FindFirstChild("HumanoidRootPart")
        
        player.Character = oldChar
        
        if oldHRP and newHRP then
            oldHRP.CFrame = newHRP.CFrame
        else
            wait("Missing HRP")
        end

        oldChar.Parent = workspace
        currenChar:Destroy()
    end
end```

This is a morph module that morphs the player into any model with an HRP and back. This works as intended but the problem occurs __when the player morphs back to their original avatar.__ The image is the result of what happens when the player shifts back. Does anyone know why this might be the case??
split ruin
#

is the humanodi root part anchored?

#

or maybe some welds could be gone

autumn abyss
#

Ill have to check

autumn abyss
#

Welp i fixed it

#

turns out constantly moving all the important scripts that literally brings the character to life

#

would technically suck the soul out of them

#

so Im guessing the humanoid got confused whenever it would transfer characters

#

So i just cloned the important stuff into the morph clone and deleted the morph clone entirely to revert it back