generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Camera script

Previous Thread :: Next Thread 
carlito1236 is not online. carlito1236
Joined: 20 Jul 2013
Total Posts: 142
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
Robertoman is not online. Robertoman
Joined: 10 May 2007
Total Posts: 6369
17 Nov 2015 11:51 AM
Silly question maybe, but is this a local script?
Report Abuse
carlito1236 is not online. carlito1236
Joined: 20 Jul 2013
Total Posts: 142
17 Nov 2015 11:54 AM
No,it's just a script inside the part.
Report Abuse
Robertoman is not online. Robertoman
Joined: 10 May 2007
Total Posts: 6369
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
carlito1236 is not online. carlito1236
Joined: 20 Jul 2013
Total Posts: 142
17 Nov 2015 12:01 PM
Oh okay.. Thank you so much :D
Report Abuse
Robertoman is not online. Robertoman
Joined: 10 May 2007
Total Posts: 6369
17 Nov 2015 12:03 PM
Also the local script needs to be in the player, not in the part.
Report Abuse
carlito1236 is not online. carlito1236
Joined: 20 Jul 2013
Total Posts: 142
17 Nov 2015 12:06 PM
Yeah I know, local script must be in StarterPack.
Report Abuse
Robertoman is not online. Robertoman
Joined: 10 May 2007
Total Posts: 6369
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
carlito1236 is not online. carlito1236
Joined: 20 Jul 2013
Total Posts: 142
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
Robertoman is not online. Robertoman
Joined: 10 May 2007
Total Posts: 6369
17 Nov 2015 12:16 PM
Could the target be moving?
Report Abuse
carlito1236 is not online. carlito1236
Joined: 20 Jul 2013
Total Posts: 142
17 Nov 2015 12:18 PM
The target isn't working, the camera is turning around it but looking to another side.
Report Abuse
carlito1236 is not online. carlito1236
Joined: 20 Jul 2013
Total Posts: 142
17 Nov 2015 12:19 PM
The target isn't moving*
Report Abuse
Robertoman is not online. Robertoman
Joined: 10 May 2007
Total Posts: 6369
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
carlito1236 is not online. carlito1236
Joined: 20 Jul 2013
Total Posts: 142
17 Nov 2015 12:38 PM
Didn't understand what you mean.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image