Custom Morph Pad Not Working (Let's Player Morph But Then The Player Can't Move And Can't Stand Upright)

Hello, I have recently gotten into rigging and would like to add a new, functional and playable model to my game that was actually modelled and rigged by me. However, when I try and use a morph pad/code I found on Toolbox it’s not functioning the way I’d quite like it to - the player is unable to move upon stepping on the morph pad and the model itself doesn’t stand upright, instead it flops down as shown in the video. This model is rigged but doesn’t have any animations yet as I’d like it to just have the default humanoid anims whilst I learn how to animate fully.

Video of what happens when the player tries to morph into the custom model:

Video of what I’d LIKE the model to do:

The code that is being used for the button:

local Button = script.Parent
local Main = Button.Parent
local MorphMdl = Main:WaitForChild("Morph")

local Debounce = false

function Unpack(Model, Parent)
	for Index, Item in ipairs(Model:GetChildren()) do
		Item.Parent = Parent
	end
end

function Replace(Character)
	local PrimaryPartCF = Character:GetPrimaryPartCFrame()
	Character:ClearAllChildren()
	local MorphClone = MorphMdl:Clone()
	MorphClone:SetPrimaryPartCFrame(PrimaryPartCF)
	local Primary = MorphClone.PrimaryPart
	Unpack(MorphClone, Character)
	Character.PrimaryPart = Primary
end

Button.Touched:Connect(function (Part)
	if Part and Part.Parent and Part.Parent:IsA("Model") and Part.Parent.Archivable == false and Part.Parent:FindFirstChildOfClass("Humanoid") then
		--Characters have the archivable property set to false by default.
		if Debounce then
			return
		end
		Debounce = true
		Replace(Part.Parent)
		wait(0.3)
		Debounce = false
	end
end)

What I’ve tried:

  • Using other free to use custom morphs in Toolbox
  • Anchoring the model
  • Searching for solutions on DevForum and other places such as YT

Any help asap would be awesome, I’d love to have this model up and running in my game even if it lacks in animations whilst I’m still learning how to animate and rig properly!

Change the player character model on the server

1 Like

Please could you elaborate? I’m not the best with scripting terms

Players have a property called ‘Character’ which contains a respective player’s character model (character in the workspace)

local Players = game:GetService("Players")

local Button = script.Parent
local Main = Button.Parent
local MorphMdl = Main:WaitForChild("Morph")

local Debounce = false

function Unpack(Model, Parent)
	for Index, Item in ipairs(Model:GetChildren()) do
		Item.Parent = Parent
	end
end

function Replace(Character)
    local Player = Players:GetPlayerFromCharacter(Character)
	local PrimaryPartCF = Character:GetPrimaryPartCFrame()
	Character:ClearAllChildren()
	local MorphClone = MorphMdl:Clone()
    Player.Character = MorphClone
	MorphClone:SetPrimaryPartCFrame(PrimaryPartCF)
	local Primary = MorphClone.PrimaryPart
	Unpack(MorphClone, Character)
	Character.PrimaryPart = Primary
end

Button.Touched:Connect(function (Part)
	if Part and Part.Parent and Part.Parent:IsA("Model") and Part.Parent.Archivable == false and Part.Parent:FindFirstChildOfClass("Humanoid") then
		--Characters have the archivable property set to false by default.
		if Debounce then
			return
		end
		Debounce = true
		Replace(Part.Parent)
		wait(0.3)
		Debounce = false
	end
end)
1 Like

Just tried this and it lets the Player morph, but still having the problem of the Player not being able to move after morphing, any idea as to what could be causing that and how to fix it? (I’ve tried unanchoring the model but when I do this it falls through the map)