Hello, I’ve made myself a ‘morph module’ to make the application of a morph onto my players a lot easier for myself. The issue I’m having is that when it goes to actually apply the morphs, which is does limb by limb, it seems like the positions of the parts/meshparts/unions aren’t replicating correctly. The morph is applied serverside.
Code:
local function applyMorphLimb(characterMorphLimbFolder,playerCharacterLimb,morphLimbModel) -- Function used to apply individual morphs
if not playerCharacterLimb or not morphLimbModel or not characterMorphLimbFolder then return end
local replicatedLimbModel = morphLimbModel:Clone();
local limbAnchorPart = replicatedLimbModel:FindFirstChild('Middle') or Instance.new('Part'); -- If an anchorPart doesn't already exist, then lets make one. Making one is LESS accurate!
if not replicatedLimbModel:FindFirstChild('Middle') then -- Check if we need to set the size or not depending on if it already exists.
limbAnchorPart.CFrame = replicatedLimbModel:GetModelCFrame();
limbAnchorPart.Size = Vector3.new(0,0,0)
end
limbAnchorPart.Name = 'Middle';
limbAnchorPart.Transparency = 1;
limbAnchorPart.Anchored = true;
limbAnchorPart.Parent = replicatedLimbModel;
replicatedLimbModel.Parent = workspace;
replicatedLimbModel.PrimaryPart = limbAnchorPart;
replicatedLimbModel:SetPrimaryPartCFrame(playerCharacterLimb.CFrame);
local morphLimbChildren = replicatedLimbModel:GetChildren();
for morphLimbPartNumberIndex,morphLimbPart in pairs(morphLimbChildren) do
if morphLimbPart ~= limbAnchorPart then
local morphWeld = Instance.new('WeldConstraint');
morphWeld.Part0 = morphLimbPart;
morphWeld.Part1 = playerCharacterLimb;
morphWeld.Name = 'morphWeld';
morphWeld.Parent = morphLimbPart;
morphLimbPart.Anchored = false;
morphLimbPart.CanCollide = false;
morphLimbPart.Parent = characterMorphLimbFolder
end
end
replicatedLimbModel:Destroy() -- All the items within the model have been moved into the character folder
end
Screenshots:
Local
Server
As you can see by the screenshots, the morph is messed up locally but is applied perfectly serverside.
Any and all help is appreciated!