|
| 24 Feb 2016 02:47 PM |
game.Workspace.CurrentCamera.CameraType = "Track"
Any ideas? |
|
|
| Report Abuse |
|
|
Daftcube
|
  |
| Joined: 10 Jan 2010 |
| Total Posts: 275 |
|
|
| 24 Feb 2016 02:49 PM |
So! This is an interesting gotcha for anyone who hasn't worked with networking before!
In studio, this code runs on your local machine.
In game, it runs on the server. On the server, there is no such thing as a camera. Servers don't do that stuff!
If you want this code to work, put it in a local script. This causes the code to be executed on the user's machine, like in studio. |
|
|
| Report Abuse |
|
|
|
| 24 Feb 2016 02:51 PM |
| Thank you for trying to help but it is in a local script |
|
|
| Report Abuse |
|
|
| |
|
iondriver
|
  |
| Joined: 18 Nov 2012 |
| Total Posts: 757 |
|
|
| 25 Feb 2016 09:34 AM |
I am not sure. Are their any errors in the output?
Also, try: game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Track |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
| |
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 25 Feb 2016 11:38 AM |
while not workspace.CurrentCamera do wait() end; local player = game:GetService("Players").LocalPlayer; player:WaitForChild("PlayerScripts"):WaitForChild("CameraScript"); (player.Character or player.CharacterAdded:wait()):WaitForChild("Humanoid"); wait(); --// guarantee hand-off from this thread to CameraScript so that initial camera setup gets done before we change things
--//change things workspace.CurrentCamera.CameraType = "Track" |
|
|
| Report Abuse |
|
|
Daftcube
|
  |
| Joined: 10 Jan 2010 |
| Total Posts: 275 |
|
|
| 27 Feb 2016 01:56 PM |
You could try
Workspace.CurrentCamera.CameraType = Enum.CameraType.Track |
|
|
| Report Abuse |
|
|