Hi devs, i just maked a script that change cameras to differents part but now am stuck bcs when i try to give the camera back to the player it doesn’t work . Does any one have the solution? tnks
local transitionTime1 = 3
local startPosition1 = cam.CFrame
local endPosition1 = camera1.CFrame
local tweenInfo1 = TweenInfo.new(transitionTime1)
local tween1 = TweenService:Create(cam, tweenInfo1, {CFrame = endPosition1})
local camera2 = workspace.Cameras.Camera2
tween1:Play()
tween1.Completed:Connect(function()
cam.CameraSubject = camera1
part = camera1
print("Camera1")
wait(47.3) -- 39
TweenFrameVisible:Play()
wait(0.7)
renderStepConnection:Disconnect()
cam.CameraType = "Scriptable"
cam.CFrame = camera2.CFrame
print("Camera2")
wait(3)
TweenFrameInvisible:Play()
wait(0.2)
game.Workspace.Intro.Gasp:Play()
wait(1.4)
TweenFrameVisible:Play()
-- afficher le nom du jeu.
wait(3)
TweenFrameInvisible:Play()
print("Camera back")
local character = LocalPlayer.Character
if character then
cam.CameraSubject = character
end
UIS.ModalEnabled = true
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
end)
end)