Camera manipulation not working

So I’m trying to use camera manipulation for my intro to my game. But, for some reason it seems not to be working.
Script:

local Camera = workspace.CurrentCamera
local target = game.Workspace.TargetPart

Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = CFrame.new(target.Position)

Thank you for your time.

2 Likes

Screenshot the Explorer and Script.
Is this LocalScript or Script? If it’s Local then you can’t use “game.Workspace or any like that”, only script.Parent…

1 Like

It isn’t that obvious, but I said it was a intro to my game so it’s probably a local script and it is.

Screenshot the Explorer. And then I would know.

What does this mean?
ActivateCameraController did not select a module.

It’s a common bug now, no one knows as I know.
Just screenshot entire Studio.

Try using a function

local Camera = workspace.CurrentCamera
local target = game.Workspace.TargetPart

game.Players.PlayerAdded:Connect(function()
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = CFrame.new(target.Position)
end)

No, Workspace, game.Workspace.TargetPart DOESNT WORK on a Localscript.

Only script.Parent does work as I know.

For some reason, it doesn’t even change anything as I can see.

local Camera = workspace.CurrentCamera
local target = workspace.TargetPart

Camera.CameraType = “Scriptable”
Camera.CFrame = that code. And make it (target.CFrame and not Position)

^^^ try this

You can’t manipulate camera on the server.

Come on already, write that message. I’m curious what you will write.

I might be wrong but, it might work if you wait for the character to load.

local Players = game:GetService('Players')

local Camera = workspace.CurrentCamera
local target = workspace.TargetPart

local player = Players.LocalPlayer

if not player.Character then
    player.CharacterAdded:Wait()
end

Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = CFrame.new(target.Position)

Sorry if I’m being a bit rude of here but, this wouldn’t really do anything since doing CFrame.new(target.Position) just makes the camera not rotate, and the problem isn’t probably because of the enum.

local Camera = game.Workspace.CurrentCamera
local Player = game.Players.LocalPlayer

repeat wait() until Player.Character

Camera.CameraType = “Scriptable”
Camera.CFrame = game.Workspace.TargetPart.CFrame

Maybe this one will work.

Sorry for not writing lol. I was doing something else.

I found the answer thanks for the help everyone!

2 Likes