Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you properly change a players camera subject?

Asked by
OBenjOne 190
6 years ago

I put the below code in a local script in the starter characterScripts and It works.

game.Workspace.CurrentCamera.CameraSubject = Workspace.Part

this causes you to look at "Part" whenever you join the game. However, The version of the script I want is this:

wait (1) game.Workspace.CurrentCamera.CameraSubject = Workspace.Part

For some reason the wait command makes the script not work!!! I'm really confused and need help.

0
It does work for me. RoyMer 301 — 6y
0
Hmmmm... the part's Parent is changed from a folder to the workspace, but it does not give an error or anything and the change is during the "wait (1)" your script is slightly different than mine so I'll try the "waitforchild" command. OBenjOne 190 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

Is the part in the workspace being changed in any way? This current script works just fine for me.

Local script:

wait(1)
workspace.CurrentCamera.CameraSubject = workspace:WaitForChild("Part")

If that still doesn't work then try checking the developer console by pressing F9. If it's completely blank and it still isn't functioning then try restarting studio. I heard a few things were broken in this latest update.

0
I added the "waitForChild" to the script and it worked. Let this be a lesson to me to always program in the proper form :D OBenjOne 190 — 6y
0
oh no!!! now the script works only in studio!!! now what do I do!!! OBenjOne 190 — 6y
Ad

Answer this question