|
| 17 Nov 2015 11:41 AM |
I made a camera that turns around a part It works in "Solo mode" but doesn't work with server Here is the script :
local target = workspace.Cam local camera = workspace.CurrentCamera camera.CameraType = Enum.CameraType.Scriptable camera.CameraSubject = target local angle = 0 local i = 0 while wait() do camera.CoordinateFrame = CFrame.new(target.Position) * CFrame.Angles(0, angle, 0) * CFrame.new(10, 5, 0) camera.Focus = CFrame.new(target.Position) angle = angle + math.rad(1) i = i + 1 if i > 600 then break end end
Please help me fix this. |
|
|
| Report Abuse |
|
|
|
| 17 Nov 2015 11:51 AM |
| Silly question maybe, but is this a local script? |
|
|
| Report Abuse |
|
|
|
| 17 Nov 2015 11:54 AM |
| No,it's just a script inside the part. |
|
|
| Report Abuse |
|
|
|
| 17 Nov 2015 11:58 AM |
| Well that is your problem... If you want players' camera moved, you have to access their camera from a local script as their camera is client side only, not server side. |
|
|
| Report Abuse |
|
|
|
| 17 Nov 2015 12:01 PM |
| Oh okay.. Thank you so much :D |
|
|
| Report Abuse |
|
|
|
| 17 Nov 2015 12:03 PM |
| Also the local script needs to be in the player, not in the part. |
|
|
| Report Abuse |
|
|
|
| 17 Nov 2015 12:06 PM |
| Yeah I know, local script must be in StarterPack. |
|
|
| Report Abuse |
|
|
|
| 17 Nov 2015 12:09 PM |
| Well it doesn't have to be in StarterPack, but yes it does need to be in a service that puts the script into the player on joining. In the old days when local scripts first came out, you had to clone it into the player, or put in in the backpack service. Now there are quite a few options for sending a script to the player instance. |
|
|
| Report Abuse |
|
|
|
| 17 Nov 2015 12:13 PM |
Oh okay, anyway do you have any idea why the camera changed angle? It was looking at the part and turning around it, now it's just turning and looking around it. |
|
|
| Report Abuse |
|
|
|
| 17 Nov 2015 12:16 PM |
| Could the target be moving? |
|
|
| Report Abuse |
|
|
|
| 17 Nov 2015 12:18 PM |
| The target isn't working, the camera is turning around it but looking to another side. |
|
|
| Report Abuse |
|
|
| |
|
|
| 17 Nov 2015 12:27 PM |
| Well, not sure if this will fix it, but why are you setting the camera.Focus property inside the loop? You should do that before the loop begins I think. Other than that, it could be your math, but if the math worked fine in play, it should work fine in the server. |
|
|
| Report Abuse |
|
|
|
| 17 Nov 2015 12:38 PM |
| Didn't understand what you mean. |
|
|
| Report Abuse |
|
|