So to understand a bit what i have, when the player joins i make the CurrentCamera scriptable and set the CFrame to a part in workspace for my main menu and their character is placed in a spawn box. When they click play the camera is set from scriptable to costum and their characters HumanoidRootPart CFrame changes to a parts CFrame in workspace to teleport them from the spawn box to the game.
Everything works fine so far no errors or anything that could break it (With their normal character). However, When a player changes their in game character and they click play it breaks it, The camera is stuck in the air and the character stays in the spawn box..
Character change script:
local Characters = game:GetService(“ReplicatedStorage”).Characters
local Event = game:GetService(“ReplicatedStorage”).Events.ChooseCharacterEvent.OnServerEvent:connect(function(player,character)
if character == “PlayerCharacter” then
player:LoadCharacter()
else
local char = Characters[character]:Clone()
char.Name = player.Name
player:LoadCharacter()
player.Character = char
player.Character.Parent = workspace
player.Character.HumanoidRootPart.CFrame = game.Workspace.PlayerSpawn.SpawnLocation.CFrame
end
end)
did a small mistake on the script above should be fixed now*