Is it possible to keep the cameras position/orientation after :LoadCharacter()?

i am attempting to create a character changer script that seems smooth to the point where it doesnt seem like you “respawned”. ive gotten the teleporting the player back to original position down but i cant seem to keep the camera position

CODE:

	local ogposition = plr.Character.PrimaryPart.CFrame
	local newskin = skin:Clone()
	newskin.Name = ("StarterCharacter")
	newskin.Parent = game.StarterPlayer
	newskin.PrimaryPart = newskin.HumanoidRootPart
	local newanimate = script:WaitForChild("SkinAnimate"):Clone()
	newanimate.Name = ("Animate")
	newanimate.Parent = plr.Character
	plr:LoadCharacter(newskin)
	
	task.defer(workspace.PivotTo, plr.Character, ogposition)


heres a video example of what i dont want the camera to do, i want it to stay in the same position it was before reloading my character

Is this code on the server or on the client?

Just save the camera cframe just like the player position.
For example:

local OldCF = workspace.CurrentCamera.Cframe
...
workspace.CurrentCamera.CFrame = OldCF

it is on the server thats the problem

Which means it’s possible to get the player camera directly from the workspace.

i meant to put server that was an accident

Oh, so, in that case, use a remote function/event to get the player’s camera cframe.

I had this problem, and I tried many different solutions, such as connecting to the camera subject changing, and checking the orientation of the camera.

However, I eventually created a custom camera module because there were too many edge cases, but I guess you could try forking the Roblox camera control scripts, since those are the only things that control the camera ingame.

1 Like

i found a solution by setting the cameratype to scriptable, reloading the character, then changing the cameratype back to custom

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.