Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why does my script not move the camera to the 'Camera' Part and moves it to Above the baseplate?

Code: local Camera = game.Workspace.Camera local Player = game.Players.LocalPlayer

--Camera--

repeat wait() until Player.Character

Camera.CameraType = "Scriptable" Camera.CFrame = game.Workspace.Camera.CFrame

script.Parent.Parent.Enabled = true

--Play Button--

script.Parent.MouseButton1Click:Connect(function() script.Parent.Parent.Enabled = false Camera.CameraType = "Custom" end)

1 answer

The problem here is that you have two objects in workspace named Camera. You have the camera itself, and the camera (which is the part).

Camera.CFrame = game.Workspace.Camera.CFrame

As you run the line of code above, its just going to grab the actual camera itself and set the CFrame to its current CFrame.

In order to fix this, rename your part to something other than Camera. As well, I would recommend accessing the camera through this way as it is the correct way when looking for the clients camera:

local Camera = workspace.CurrentCamera

This discussion is preserved as it was. New answers, comments, and votes are closed.