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

Why isn't this camera script working?[Solved]

When the player (re)spawns their camera will focus on "CameraPart" but it isn't doing it at all! Why not? Here is my finished script

wait(0.5)
Workspace.CurrentCamera.CameraSubject = Workspace.CameraFocus1
Workspace.CurrentCamera.CameraType = "Attach"

Thank you!!! --this is a local script

3 comments

0

What are you trying to achieve? The script above will ONLY make the camera focus on CameraPart (which is what you said it does).

0

That is the only thing I want it to do, unfortunately it isn't doing that!

0

I am pretty sure the error has to do with the PlayerAdded part!

1 answer

✓ Accepted answer

To change a camera's view, firstly you must use a local script inside of the player as only a local script is able to communicate with a camera. Secondly, you should use CurrentCamera not Camera, that's just a instance which is created every time a player spawns, it's not uniquely controllable. By using a local script, this also means you don't need to use PlayerAdded or CharacterAdded, you can just place a localscript inside the StarterGui or StarterGear. This code should work:

Workspace.CurrentCamera.CameraSubject = Workspace.SpawnPlate1

2 comments

0

That worked but it focuses on a random space, is there a way to fix that?

0

Try adding a second brick in the direction you'd like the camera to face, set the Focus of the camera to this brick.

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