Unable to control character after setting player.Character

Try changing the clothes, accessory and face ids insead

Can’t really join the game if I do that since I disabled CharacterAutoLoads. I’ve done this and it worked before, but I’m just randomly getting this error because I’m attempting to do this locally.

I’m familiar with most methods of making custom characters but I’m going the extra mile to create my own respawn logic. This is the first step of that.

You can just enable CharacterAutoLoads again or use a script
game.Players.PlayerAdded:Connect(function(plr)
plr:LoadCharacter()
end)

Well in that case your character might not have the animator script

It has everything, trust me on that

magical555 did you try my method?

Yea. I’ve already done this before, the character itself is not the issue. Here’s a server side script that I made using the same concepts here which still works. I can move the character properly (and respawn) w/ this script, it’s just not local.
image

Characters used in this script are the exact same as what I’m using right now.

I think I get it now. When you join the game, your character sets to alpha… But when you die it will be set to beta. Change the scripts back to the one that you said was working. Join the game and reset your character. If you couldn’t control your character after you reset then that means there is a problem with the beta model.
Another reason might be that you are trying to change the player’s character on the client. But changes on the client cannot be detected on the server so you should just do it on the server instead.

1 Like

Beta is a clone of alpha, just renamed. Nothing wrong with it either.

You’re probably right about the error coming from my attempt to change the player’s character on the client. However, the reason I’m attempting this is because that last script I just posted sets all players to a single character (which is super problematic). Is there any way that I can even set the player’s character on the server while still giving each player their own character?

Do you mean all the players in the game is loaded into a single character and they are controlling one single character? Or, do you mean they have the same looking character but just duplicates?

Yea, the issue was that all players controlled a single character. I want them to all have their own 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.