01 | local rooms = game.Workspace:WaitForChild( "Rooms" ) |
02 | local camera = game.Workspace:WaitForChild( "Rooms" ):WaitForChild( "Camera1" ) |
03 | local target = game.Workspace:WaitForChild( "Rooms" ):WaitForChild( "Target1" ) |
04 | local cam = game.Workspace.CurrentCamera |
05 | local Button = script.Parent |
06 |
07 |
08 | function SendCamera() |
09 | wait( 10 ) |
10 | cam.CameraSubject = camera |
11 | cam.CameraType = "Custom" |
12 | cam.Focus = CFrame.new(target.Position) |
13 | cam.CoordinateFrame = CFrame.new(camera.Position) |
14 | end |
15 |
16 | if cam.Cameratype = "Custom" then |
17 | cam.Cameratype = "Scriptable" |
18 | Button.MouseButton 1 Click:connect(SendCamera) |
Tried all possible with this and it wont work
Where to start?
I'll be very pedantic and picky so you can make the most out of your code! The more efficient the better! If this still doesn't work, try rethinking the algorithm as I've no idea what it's supposed to be doing.
01 | local rooms = game.Workspace:WaitForChild( "Rooms" ) -- make sure these all exist first, the new updates should mean that warnings are triggered if this is the reason for its failure. |
02 | local camera = game.Workspace:WaitForChild( "Rooms" ):WaitForChild( "Camera1" ) |
03 | local target = game.Workspace:WaitForChild( "Rooms" ):WaitForChild( "Target1" ) |
04 | -- ^ change the "game.Workspace:WaitForChild("Rooms")" in camera and target to just "rooms" |
05 | -- (sorry for being pedantic xD) |
06 | local cam = game.Workspace.CurrentCamera |
07 | local Button = script.Parent |
08 |
09 |
10 | function SendCamera() |
11 | wait( 10 ) -- Is this wait meant to be here? Just curious |
12 | cam.CameraSubject = camera |
13 | cam.CameraType = "Custom" -- THIS NEEDS TO BE SCRIPTABLE (Enum.CameraType.Scriptable) |
14 | cam.Focus = CFrame.new(target.Position) -- this doesn't include rotation, change this to "cam.Focus=target.CFrame" |
15 | cam.CoordinateFrame = CFrame.new(camera.Position) -- this too doesn't include rotation, change this to "cam.CoordinateFrame=camera.CFrame" |
Cheers :) CD