i've created a camera manipulation for my custom Gui. How it works is that it moves the camera to follow a brick, when ever a button is clicked. It works perfectly in studio mode The Camera Moves to the next object on every click. Not one signal error comes up. But as soon as i run a server test, or upload it and test it on play, nothing with the camera movement works and i get no errors. My camera controller is in a local script.
01 | local function MoveCamera(Direction) |
02 | local FollowBrick = MoveBrick:InvokeServer(Direction) |
03 | Camera = workspace.CurrentCamera |
04 | if (Direction ~ = "End" ) then |
05 | print ( "It is not End" ) |
06 | Camera.CameraType = Enum.CameraType.Scriptable |
07 | Camera.CameraSubject = FollowBrick |
08 | Camera.CFrame = CFrame.new( 0 , 25 , 1 ) |
09 | Camera.CFrame = CFrame.new(FollowBrick.Position) * CFrame.new( 0 , 0 , 1 ) * CFrame.Angles( 0 ,math.rad( 180 ), 0 ) |
10 | else |
11 | Parent.Enabled = false |
12 | end |
Ok, Let me guess, your script isn't a local script. I have had experience with things working in studio but not in game. If it is a script, it will be trying to access your camera, but can't. workspace.Camera can be done with a local script, because the camera will be local to the player. I would basically just copy your script then make it into a local script.