i have a script that changes my Character model to another while in game.
it works but it also resets the Cameras Position, which is not what i want.
i have tried to make camera.Type = “Scriptable” then setting the cframe to before it was changed, but after that i am not able to move the camera until i set it back to Custom, and when i set it back to custom, it just resets the camera again
it appears that you delete your character upon switching to a new one. I think it might cause the CameraSubject property to lose its subject and reset the camera. Maybe you could try this
--Create a the new character
local initialCameraCFrame = camera.CFrame
camera.CameraSubject = newChar
--Destory old character
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = initialCameraCFrame
camera.CameraType = Enum.CameraType.Custom
Hello, can you send the script please? of resetting avatar-
Literally you only have to do
local savedcam = Camera.CFrame
– Reset plr
wait()
Camera.CFrame = savedcam
This is just an awkward property of the Camera working with Humanoids. There is no event to wait for when the camera is changed, so the best you can do is add a task.wait(0.1) before setting the camera CFrame to its old CFrame.
Wait for the CFrame to change before setting the camera’s CFrame once the character is added, like this:
local Players = game:GetService("Players")
local camera = workspace.CurrentCamera
local player = Players.LocalPlayer
local oldRot = CFrame.new()
player.CharacterAdded:Connect(function(character)
camera:GetPropertyChangedSignal("CFrame"):Wait()
camera.CFrame = CFrame.new(camera.CFrame.Position) * oldRot
end)
player.CharacterRemoving:Connect(function()
oldRot = camera.CFrame - camera.CFrame.Position
end)