Camera will not work after reset

If the Player spawns multiple Times it will work every Time.

But after the Player resets himself, the Player will Spawn but the Camera will not change.

U will see in the Video after i tried to Spawn again after i reset on the Bottom-Right a Error Message 02, this means the Character is not loaded now and this Script is working.

It will work again if the Character is loaded. But when the Character is loaded the Camera will not change.

Video:

robloxapp-20220901-0253450.wmv (3,2 MB)

Camera Script:

local TweenService = game:GetService("TweenService")

local player = game.Players.LocalPlayer

local introCameras = game.Workspace:WaitForChild("IntroCameras")

local tweenInfo = TweenInfo.new (
	50,
	Enum.EasingStyle.Quad,
	Enum.EasingDirection.InOut,
	-1,
	true,
	0
)

local tweenCreate = TweenService:Create(game.Workspace.CurrentCamera, tweenInfo, {CFrame = introCameras.IntroCamera3.CFrame})

game.ReplicatedStorage:WaitForChild("CameraMenuAnimation").Event:Connect(function(trueNilOrFalse)
	
	if trueNilOrFalse == false then

	tweenCreate:Cancel()
		
	elseif trueNilOrFalse == true then
		
		if workspace.CurrentCamera.CameraType ~= Enum.CameraType.Scriptable then
			workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
			end
		
		tweenCreate:Play()
		
	elseif trueNilOrFalse == nil then
		
		if workspace.CurrentCamera.CameraType ~= Enum.CameraType.Scriptable then
			workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
		end
		
		workspace.CurrentCamera.CFrame = introCameras.IntroCamera2.CFrame
		
	end
		
	end)

game.ReplicatedStorage:WaitForChild("PassengerRemoteEvent").OnClientEvent:Connect(function()
	
	workspace.CurrentCamera.CameraType = Enum.CameraType.Custom

	workspace.CurrentCamera.CFrame = CFrame.new(player.Character.HumanoidRootPart.CFrame.LookVector)
	
end)
1 Like

Where is the script located? Is it possible it’s a descendant of something with ResetOnSpawn set to true?

ResetOnSpawn is in every GUI to false and its localscript

U will see in the Video after i tried to Spawn again on the Bottom-Right a Error Message 02, this means the Character is not loaded now and this Script is working. It will work again if the Character is loaded, but when the Character is loaded the Camera will not change to the Player.

It worked after i added workspace.CurrentCamera.CameraSubject = player.Character.Humanoid.
But i dont understand why i need to use CameraSubject just after the Character Died

The camera doesn’t update when the type is Scriptable. This includes setting the camera to the new humanoid. If you still want this functionality, I believe setting the camera type to Fixed will solve this.

1 Like

I already changed the Camera to Custom u can see in the script above me but it dont works but changing the CameraSubject to Humanoid works now, but Thanks, i dont know really.