Can someone help me with Camera Manipulation

Hello,

So I have had an issue with camera manipulation a ton. I just don’t understand why my code is not working when I check the docs for camera manipulation and just don’t understand. Can someone please help me.

Events.PlayerJoined.OnClientEvent:Connect(function()

print("runs")

Camra.CameraType = "Scriptable"

Camra.CFrame = workspace.Flour.CFrame

end)

what is the error in the output?

I get no error. That’s the issue I just don’t understand what I am doing incorrectly. I just have never understood how Camera Manipulation works.

this is odd because it worked fine for me when I tested it. where are you storing this local script?

StarterPlayerScript is where it is currently stored.

alright, I see a few possible problems.

  1. if your print statement is never being fired, it might be a problem with the remotevent.

  2. you might not be getting the camera properly. the camera’s directory should be workspace.CurrentCamera.

  3. your code could be running too early. It’s listening for when the player joins but not when the character is added to workspace.

  4. it could be a problem with conflicting code

the most likely problem is 1., since you say you’re not getting any errors

Ok so,

  1. It does print out

image

  1. I think I got the camera correctly (you can view code)

  2. I want it to run when the player is added so that it does not change the camra after a user resets (I don’t see how this would cause an issue and also I have tested it with the character added event and it still does not work)

  3. I don’t have any code that would conflict it. The script is the only one that changes the camra.

I’m a little bit confused here. this is the way I did it.

I put a localscript in StarterCharacterScripts with the following code:

Camra = workspace.CurrentCamera

task.wait(3)

print("runs")

Camra.CameraType = "Scriptable"

Camra.CFrame = workspace.Flour.CFrame

I put a part in workspace that is named Flour.

–forget that last part, I made a mistake (deleted now)

I tested the code you used and that does not even work for me.

if that is the case then your code is completely fine. the only thing I can think of is the camera being affected elsewhere, which is odd since you said it’s not.

I tested it inside of the main game and it works but only seems not to work in studio,.

that could just be a weird studio bug, then. I don’t know what else it could be if the works in the main game. try reopening studio?

You need a camera subject. Something like this:

Events.PlayerJoined.OnClientEvent:Connect(function()
    print("Code executing!")

    Camera.CameraType = Enum.CameraType.Scriptable
    Camera.CameraSubject = workspace.Flour
    Camera.CFrame = workspace.Flour.CFrame

    print("Code excecuted!")
end)

I suggest using CameraUtil - Your new tool for simple camera manipulation! (OPEN-SOURCED)
It has a ton of features and it is very easy to use.

You could just get the code in line runner, a roblox template.