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 » Scripting Helpers
Home Search
 

Re: CameraSubject script not working?

Previous Thread :: Next Thread 
Tripane is not online. Tripane
Joined: 03 Jun 2011
Total Posts: 11432
20 Sep 2014 12:55 PM
local Target = game.Workspace.Part
local Camera = game.Workspace.CurrentCamera
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CameraSubject = Target
Report Abuse
SirNoobly is not online. SirNoobly
Joined: 01 Oct 2009
Total Posts: 253
20 Sep 2014 01:00 PM
Local script?
Report Abuse
Tripane is not online. Tripane
Joined: 03 Jun 2011
Total Posts: 11432
21 Sep 2014 09:23 AM
yes
Report Abuse
Nyxis is not online. Nyxis
Joined: 15 Nov 2012
Total Posts: 3374
21 Sep 2014 09:24 AM
do you know where it is breaking?
Report Abuse
Tripane is not online. Tripane
Joined: 03 Jun 2011
Total Posts: 11432
21 Sep 2014 09:25 AM
no, I am not getting output

Report Abuse
Nyxis is not online. Nyxis
Joined: 15 Nov 2012
Total Posts: 3374
21 Sep 2014 09:25 AM
I recommend putting prints between the lines to find out where it stops.
Report Abuse
Tripane is not online. Tripane
Joined: 03 Jun 2011
Total Posts: 11432
21 Sep 2014 09:27 AM
Added a print after line 3, didn't print

so the problem is there, right?
Report Abuse
Nyxis is not online. Nyxis
Joined: 15 Nov 2012
Total Posts: 3374
21 Sep 2014 09:29 AM
if it stops printing, then the line afterwards is probably the issue.
Report Abuse
Tripane is not online. Tripane
Joined: 03 Jun 2011
Total Posts: 11432
21 Sep 2014 09:31 AM
so what's wrong with line 4?
Report Abuse
Nyxis is not online. Nyxis
Joined: 15 Nov 2012
Total Posts: 3374
21 Sep 2014 09:34 AM
does it make the cameratype scriptable?
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
21 Sep 2014 09:35 AM
Is the script in startergui or starterpack?
Report Abuse
VanillaLight is not online. VanillaLight
Joined: 02 Nov 2013
Total Posts: 834
21 Sep 2014 09:36 AM
Debug like you've never debugged before.

local Target = game.Workspace:FindFirstChild("Part")
if Target then
local Camera = game.Workspace:FindFirstChild("CurrentCamera")
if Camera then
print("Camera AND Target")
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CameraSubject = Target
else print("No camera!") end
else print("No target!") end
Report Abuse
flump is not online. flump
Joined: 30 Jul 2008
Total Posts: 1039
21 Sep 2014 10:01 AM
You're setting the camera to scriptable. This makes CameraSubject useless and requires the camera to be positioned by the script manually through coordinateFrame. If you want the camera to follow the part set the CameraType to Custom
Report Abuse
Tripane is not online. Tripane
Joined: 03 Jun 2011
Total Posts: 11432
21 Sep 2014 10:35 AM
Camera.CameraType = Enum.CameraType.Custom
Camera.CameraSubject = game.Workspace.Part

CameraSubject never changes to part.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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