How do I make it so that the camera returns to the player?
Asked by
3 years ago Edited 3 years ago
I need some help trying to get the camera to return to the player.
So I got this script to work with my GUI's (Script below) and I can't figure out how to script it so the camera returns to the player after they hit the play button, Because right now everything works but the camera is stuck in the camera transition phases from block to block but gets stuck once it stops at the end block and won't move on to the 2nd set of blocks.
This script is a localscript.
02 | local tween = game:GetService( "TweenService" ) |
03 | local cam = workspace.Camera |
04 | local scenes = workspace.CameraScenes |
05 | local currentTween = nil |
08 | repeat wait() until cam.CameraSubject ~ = nil |
10 | cam.CameraType = Enum.CameraType.Scriptable |
13 | for i, v in pairs (scenes:GetChildren()) do |
14 | if looping = = false then return end |
15 | cam.CFrame = v [ "1" ] .CFrame |
16 | currentTween = tween:Create(cam, TweenInfo.new( 10 ), { CFrame = v [ "2" ] .CFrame } ) |