How To Make A Custom Character Loader

I would like to be able to load a different custom character for each player in my game. In ServerStorage, I have all the custom character models already stored. So I just need to load one of the stored character models to each player.

How would I go about creating a custom character loader script that loads a custom character for each player?

Edit: I was able to get this to work using the following code in a PlayerAdded script:

player:LoadCharacter() 

local customCharacter = game.ServerStorage.Dummy:Clone()
player.Character = customCharacter
customCharacter.Parent = game.Workspace
14 Likes

Are you using R6 or R15 for your custom models? Also, will the character model change each time a certain player respawns/joins or are you looking to keep the same character model for a player?

1 Like

It is for R15 rig.

And the character model will not change for a given player. For example, if player 1 is a wizard class, they will always spawn as a wizard character. If player 2 is a warrior class, they will always spawn as a warrior character.

1 Like

I would assume that when a player spawns in, you can check what class they are, and then loop through each object in that class’s character model and clone it to the player? Is there a reason this wouldn’t work, or am I misunderstanding what you mean when you say custom character. Are these just things such as accessories, shirts, pants, etc…?

The custom characters all have unique meshes. And in some cases the Motor6D joints are aligned differently. And some characters have different accessories.

Ah, I can’t be much help involving Motor6D and joints. My usual solution for characters is to disable LoadCharacterAppearance, and then just use Clone() and AddAccessory().

The correct way to do this is to disable characterAutoLoads and directly set player.Character as you’ve been trying. This must be set from the server, and the character model must be cloned and must already contain a Humanoid iirc.

Also bear in mind that by disabling characterAutoLoads you’ll need to write your own respawn logic.

12 Likes

I’m doing the same thing, setting player.Character manually, and have noticed some quirks. I found that I had to manually set the camera on the client to point to the new character after, and weirder I had to toggle the Animate script off and on to get animations to play again.
Something that’s happening to me intermittently now, and only when running from the website, is the characters sinking into the ground in permanent Freefall state:

https://gyazo.com/d8df021959b7b6ed3b1ac2daa71ab34a

I’m thinking there must be a step I’m missing, perhaps related to the Animate script, that will make this work. Any ideas? Where is the code that is supposed to detect a character landing from Freefall and change its state?

3 Likes

This is a bump, but I believe others would benefit from this information as I was stuck on this problem myself

it is vital that you set the player’s character before you parent the character to workspace and this will automatically set the player’s camera and run the local scripts inside of the character

    local character = characterModel:Clone()
    character.Name = player.Name
    player.Character = character
    character.Parent = workspace
40 Likes