Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Camera Manipulation Wont work in game?

Asked by 6 years ago

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.

local function MoveCamera(Direction)
    local FollowBrick = MoveBrick:InvokeServer(Direction)
    Camera = workspace.CurrentCamera
    if(Direction ~= "End")then
        print("It is not End")
        Camera.CameraType = Enum.CameraType.Scriptable
        Camera.CameraSubject =  FollowBrick
        Camera.CFrame =  CFrame.new(0,25,1)
        Camera.CFrame = CFrame.new(FollowBrick.Position) * CFrame.new(0,0,1) * CFrame.Angles(0,math.rad(180),0) 
    else
        Parent.Enabled = false
end
0
There could be very errors, try using repeat to do repeat wait() Camera.CameraType = Enum.CameraType.Scriptable until Camera.CameraType == Enum.CameraType.Scriptable could we see the other scripts also? User#20388 0 — 6y
0
The only thing else is a player touch part script, which would activate the gui(which works), then it would activate this MoveCamera. But i did notice that in stuido it would work and change the Camera type to scriptable, but in game, it is not changing at all. HalfMindedStudios 0 — 6y

1 answer

Log in to vote
0
Answered by
Jo_Bot 67
6 years ago

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.

0
It is in a local script HalfMindedStudios 0 — 6y
0
Hmm, I should of read "My camera controller is in a local script." I honestly do not know, I would recommend analyzing and understanding your code better. Jo_Bot 67 — 6y
Ad

Answer this question