Unable to control character after setting player.Character

I think I get it. In the function loadcharacter, you set alpha to workspace, which will cause every player to control one alpha. What you would want to do is this:

function loadcharacter(player)
    local newCharacter = alpha:Clone()
    newCharacter.Name = player.Name
    newCharacter.Parent = workspace
    player.Character = alpha
end

This way, the original alpha stays in server storage. The character you own will be a duplicate because of the Clone() function. If this worked, I would appreciate it if you could mark this as solution so others can see it.

No luck. The function makes sense, but it breaks (due to attempting to clone alpha, for some reason). I rewrote the whole script multiple times and tried cloning alpha in other ways, which worked - but only for one player. The other player can’t get their own character for some reason. No errors in output either.

I think something is wrong with cloning something in server storage?

I could not understand the problem quite effectively during this whole topic, but I have a question: Are you insisting that the character should only be seen locally by the player controlling it? If so, that might be quite impossible, as controlling the character should be seen by every player and not just you. At that point, you might wanna set the character in a server-sided script then make your character invisible on server-side, but visible on the client. I am not sure if this will work but logically, if Roblox’s logic isn’t broken, it should.

Hello hallow,

Sorry if this discussion was unclear, but the goal is simply to have each player control their own character as they spawn in the game. I’m not trying to edit the visibility of these characters. This is just the process of writing my own spawn/respawn logic since my game’s mechanics won’t work with CharacterAutoLoads.

Not quite sure how to fix this problem but I think one of the issues I’m facing right now is cloning something from server storage. If I fix that, I’ll probably be able to solve everything else.

If you have any insight on how to fix the code I wrote so that each player gets their own fully functional character, please let me know!

Is the HumanoidRootPart of the beta character anchored?

I see. So the goal is to have players get their own custom character on both spawn and respawn, right?

The way I did this in my game is to use PlayerAdded, then use CharacterAdded event in the joined player afterwards.

When the character spawns, that’s a sign the player is ready for character switching.

Clone the new character then set the new character’s root part’s CFrame to the player’s character’s CFrame (or anywhere else you want). Then set the player’s character to the new character. Destroy the old character afterwards.

Also, make a sign too that the character has been switched so the CharacterAdded event doesn’t fire infinitely and crash your game, this can simply be done by detecting a certain value in the new character to check if it’s actually the new one or not.

I hope how I explained it is understandable,I am not fluent in English.

1 Like

If you only want the game to work the same with the autoloadcharacter set to false, you can do this:
game.Players.PlayerAdded:Connect(function(player)
player:LoadCharacter()
player.Character.Humanoid.Died:Connect(function()
player:LoadCharacter()
end)
end)

This way whenever the player dies it will respawn the player immediately. If you want a delay, add a wait() in front of the player:LoadCharacter

1 Like

Hey guys did it work? If it did then you can mark is as solution so it is helpful to others.