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: CurrentCamera

Previous Thread :: Next Thread 
Seeumliam is not online. Seeumliam
Joined: 06 May 2013
Total Posts: 5662
25 Sep 2014 05:16 PM
so I read some on the wiki and made this what is wrong with it, it is in a local script inside startgui

local cam = game.Workspace.CurrentCamera
while wait() do

cam.Focus=game.Players.LocalPlayer.Character.Torso
end
Report Abuse
kingping259 is not online. kingping259
Joined: 09 Mar 2009
Total Posts: 275
25 Sep 2014 05:23 PM
Instead of

cam.Focus=game.Players.LocalPlayer.Character.Torso
end

Use

cam.CurrentSubject = game.Players.LocalPlayer.Character.Torso
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
25 Sep 2014 05:24 PM
I have no idea exactly what you're trying to do. I would love to help if you would clarify on what you are trying to accomplish here.
Report Abuse
Seeumliam is not online. Seeumliam
Joined: 06 May 2013
Total Posts: 5662
25 Sep 2014 05:27 PM
CurrentSubject is not a valid member of Camera


I am trying to get the camera to always face the player.
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
25 Sep 2014 05:32 PM
Well to start with the basics the camera takes time to load in, so you'll need to yield.

repeat wait(.5) until Workspace.CurrentCamera
Report Abuse
kingping259 is not online. kingping259
Joined: 09 Mar 2009
Total Posts: 275
25 Sep 2014 05:33 PM
local cam = game.Workspace.CurrentCamera
cam.CameraType = Enum.CameraType.Attach

Try that.
Report Abuse
kingping259 is not online. kingping259
Joined: 09 Mar 2009
Total Posts: 275
25 Sep 2014 05:34 PM
@Josh, No, the camera loads almost instantaniously, you never need a wait.
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
25 Sep 2014 05:36 PM
No it loads instantly in studio. This script will run before the camera or character is even created.
Report Abuse
kingping259 is not online. kingping259
Joined: 09 Mar 2009
Total Posts: 275
25 Sep 2014 05:37 PM
http://www.roblox.com/Fixed-Kingping259s-Sword-Center-place?id=144380738

My game ^

Camera script has NO wait at all and works EVERY time.

> gg no re <
Report Abuse
Seeumliam is not online. Seeumliam
Joined: 06 May 2013
Total Posts: 5662
25 Sep 2014 05:39 PM
Thanks that made it so it focuses on player, but is there a way to make it so if you hold right click, it won't let your camera move?
Report Abuse
kingping259 is not online. kingping259
Joined: 09 Mar 2009
Total Posts: 275
25 Sep 2014 05:41 PM
@Seeumliam, It should not move since it's type is attach.
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
25 Sep 2014 05:44 PM
If you don't want the camera to move just do something like


repeat wait(.5) until Workspace.CurrentCamera

local char = Workspace:WaitForChild(game.Players.LocalPlayer.Name)
local cam = Workspace.CurrentCamera
cam.CameraType = "Scriptable"

game:GetService("RunService").RenderStepped:connect(function()
cam.CoordinateFrame = char.HumanoidRootPart.CFrame
end)
Report Abuse
Seeumliam is not online. Seeumliam
Joined: 06 May 2013
Total Posts: 5662
25 Sep 2014 05:56 PM
The only problem with that is that I have another script that makes your view zoomed out so it should look down on the player.
Report Abuse
xolbStudios is not online. xolbStudios
Joined: 05 Nov 2009
Total Posts: 504
25 Sep 2014 06:04 PM
@kingping
lol your camera isn't very smooth x)
Report Abuse
kingping259 is not online. kingping259
Joined: 09 Mar 2009
Total Posts: 275
25 Sep 2014 06:10 PM
@xolb,

Yeah but if I made it smoother it would take about 30 seconds just to get through the spinning sequence... so I just kept it like that.
Report Abuse
xolbStudios is not online. xolbStudios
Joined: 05 Nov 2009
Total Posts: 504
25 Sep 2014 06:11 PM
lol no
you clearly don't know what interpolation is :)
Report Abuse
kingping259 is not online. kingping259
Joined: 09 Mar 2009
Total Posts: 275
25 Sep 2014 06:14 PM
@xolb, I don't experiment with camera's much since I never use them, but Seeumliam's problem was simple, so I just answered his and moved on. 8)
Report Abuse
xolbStudios is not online. xolbStudios
Joined: 05 Nov 2009
Total Posts: 504
26 Sep 2014 03:24 PM
Smooth camera here o3o
http://www.roblox.com/--place?id=179419478
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