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.
-
if your print statement is never being fired, it might be a problem with the remotevent.
-
you might not be getting the camera properly. the camera’s directory should be workspace.CurrentCamera.
-
your code could be running too early. It’s listening for when the player joins but not when the character is added to workspace.
-
it could be a problem with conflicting code
the most likely problem is 1., since you say you’re not getting any errors
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)
You could just get the code in line runner, a roblox template.