I've tried a bunch of methods, different pages, but I just CANT seem to get the camera to move back to the player! Please try to get back to me asap, it's stressing me out. this is my LOCAL script and its inside of starter player scripts.
local TweenService = game:GetService("TweenService") local player = game.Players.LocalPlayer local camera = workspace.CurrentCamera player.CharacterAdded:Wait() camera.CameraType = Enum.CameraType.Scriptable function CameraMove(pos1, pos2, tweenbool) local spd = 0 if tweenbool == true then spd = 5 end local info, posnx = TweenInfo.new( spd, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0 ), { CFrame = CFrame.new(pos1, pos2) } local tween = TweenService:Create(camera, info, posnx) camera.CameraType = Enum.CameraType.Scriptable tween:Play() end CameraMove(workspace.Camera1.Position, workspace.SpawnLocate.LightPart.Position, false) game.ReplicatedStorage.Events.BindableEvents.PlayerPressedPlay.Event:Connect(function() --Im trying to reset the camera HERE end)
There are two methods you could use to reset the camera: First, you can destroy the Camera object and I believe it should reset. If it doesn't, you can set the CameraType to Custom and set the CameraSubject to the player's humanoid.
You should just be able to set the camera type back to custom if i'm not mistaken. So the script should look like this:
local TweenService = game:GetService("TweenService") local player = game.Players.LocalPlayer local camera = workspace.CurrentCamera player.CharacterAdded:Wait() camera.CameraType = Enum.CameraType.Scriptable function CameraMove(pos1, pos2, tweenbool) local spd = 0 if tweenbool == true then spd = 5 end local info, posnx = TweenInfo.new( spd, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0 ), { CFrame = CFrame.new(pos1, pos2) } local tween = TweenService:Create(camera, info, posnx) camera.CameraType = Enum.CameraType.Scriptable tween:Play() end CameraMove(workspace.Camera1.Position, workspace.SpawnLocate.LightPart.Position, false) game.ReplicatedStorage.Events.BindableEvents.PlayerPressedPlay.Event:Connect(function() camera.CameraType = Enum.CameraType.Custom end)