I’m creating a game where your character changes into different characters based on how much XP you have (to keep it short). I’m trying to use StarterCharacter to morph the R15 players into the correct morph since R15 players are made up of MeshParts and MeshIds can’t be changed through scripts.
This is my code in StarterPlayer to change the StarterCharacter locally when it’s time to switch morphs:
game.ReplicatedStorage.Functions.UpdateRobot.OnClientInvoke = function()
print("updating robo appearance")
local newRobot = game.ReplicatedStorage.RobotArmors[Utils.CalculateLevel(game.ReplicatedStorage.Functions.GetPlayerStat:InvokeServer("XP"))]:Clone()
if player.UserId > 0 then
for i, v in pairs(game.Players:GetCharacterAppearanceAsync(game.Players.LocalPlayer.UserId):GetChildren()) do
v.Parent = newRobot
end
end
if game.StarterPlayer:FindFirstChild("StarterCharacter") then
game.StarterPlayer.StarterCharacter:Destroy()
end
newRobot.Name = "StarterCharacter"
newRobot.Parent = game.StarterPlayer
return true
end
This works fine in Play Solo and in test servers it correctly changes the StarterCharacter, but in live games and test servers it doesn’t use the StarterCharacter when the player respawns. Is this because the StarterCharacter has to be set on the server and not on the client?
There is only one solution that I can guarantee will work – set the transparency of all the normal parts to 1, then add new parts and weld them to their corresponding body parts
Anything else will probably result in breaking/modifying the core joints, which would kill the character. I have an additional idea, and that could be to set the core joints’ part properties to the new parts, one at a time so nothing is broken in one go. That may not work, though.
you would have to test this, but maybe you could disable the dead state of the humanoid (i would do it both server and client if you have filtering enabled) then do the changing of parts, then rebuild the joints, and then turn humanoids death on again. I have never done this, but its something you might look into.
StarterCharacter isn’t for this purpose. You’ll need a custom character loading system.
Also to note, you’ve posted a thread similar to this one and received an appropriate answer as to how to accomplish your goal. The question doesn’t really differ between that post and this one.