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: Locking Camera?

Previous Thread :: Next Thread 
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
02 Oct 2012 12:05 PM
How to change the positioning of the camera to brick named "CameraPos" and lock it to where you can't move the camera?

Sooo I went to the wiki... And found this:

game.Workspace.CurrentCamera.Focus = CFrame.new(game.Workspace.Part.Position)

I would change part to "CameraPos" to make the camera focus on that part?

(yes I know its a Local script)



So here is all that I got :l

while wait() do
game.Workspace.CurrentCamera.Focus = CFrame.new(game.Workspace.CameraPos.Position)
cam.CameraType = "Fixed" --guessing this will lock it...





Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
02 Oct 2012 12:07 PM
Did you define 'cam' ?
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
02 Oct 2012 12:10 PM
Noo... I forgot to put that in...

Correction:

cam = workspace.CurrentCamera

while wait() do
game.Workspace.CurrentCamera.Focus = CFrame.new(game.Workspace.CameraPos.Position)
cam.CameraType = "Fixed" --guessing this will lock it...
Report Abuse
technoguyx is not online. technoguyx
Joined: 05 Dec 2008
Total Posts: 8286
02 Oct 2012 12:12 PM
I believe you may only change CFramed properties of a Camera, when said camera is Scriptable:

cam.CameraType = "Scriptable"
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
02 Oct 2012 12:13 PM
Ah : >

Erm...ummm...eeeee are player given the local script when they join (PlayerAdded) ? I know solo mode can mess that up, even if there is no errors. Not too sure other than that.
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
02 Oct 2012 12:23 PM
No, I was hoping I could just put this in the starterpack or startergui and it work... then I just remembered... That only works once...

PlayerAdded or PlayerRespawn which one do i need to use?
Report Abuse
Oreology is not online. Oreology
Joined: 15 Sep 2012
Total Posts: 507
02 Oct 2012 12:24 PM
Just make it a localscript and put it into the starterpack.

☜▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☞
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
02 Oct 2012 12:28 PM
PlayerAdded CharacterAdded straight after
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
02 Oct 2012 10:22 PM
Okay so here's what I got:

function PlayerAdded(player)
wait()

cam = workspace.CurrentCamera

while wait() do
game.Workspace.CurrentCamera.Focus = CFrame.new(game.Workspace.CameraPos.Position)
cam.CameraType = "Fixed" --guessing this will lock it...

game.Players.PlayerAdded:connect() --what do i put here?

Do I do it right? Am I missing anything (Other then the connection line thingy)
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
02 Oct 2012 10:52 PM
Oh and... where do I put this script? StaterPack or StarterGui?
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
03 Oct 2012 12:22 AM
Help?
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
03 Oct 2012 06:05 AM
...
Report Abuse
cheatmaster18 is not online. cheatmaster18
Joined: 29 Oct 2010
Total Posts: 1871
03 Oct 2012 06:17 AM
In the connection line you put a function in this case it is PlayerAdded so it will be:
game.Players.PlayerAdded:connect(PlayerAdded)
Report Abuse
99Nickster is not online. 99Nickster
Joined: 27 Jan 2012
Total Posts: 289
03 Oct 2012 06:33 AM
Put 'Script2' into 'Script1'. Disable 'Script2'. I'm on my iPhone so there might be a few minor errors.

Script2:

cam = workspace.CurrentCamera

game.Workspace.CurrentCamera.Focus = CFrame.new(game.Workspace.CameraPos.Position)
cam.CameraType = "Scriptable"

Script1:

game.Players.PlayerAdded:connect(function(P)
P.CharacterAdded:connect(function(C)
local Cam = script.CHANGETHISTOSCRIPT2'sNAME
local Clone = Cam:Clone().Parent = P.Playergui
Clone.Disabled = false
end)
end)
Report Abuse
99Nickster is not online. 99Nickster
Joined: 27 Jan 2012
Total Posts: 289
03 Oct 2012 06:35 AM
Put the Script into Workspace, by the way.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
03 Oct 2012 07:19 AM
You can't put it in workspace
Report Abuse
99Nickster is not online. 99Nickster
Joined: 27 Jan 2012
Total Posts: 289
03 Oct 2012 07:24 AM
Step 1 click and hold on script. Step 2 drag it in Workspace. And look at what the scripts does before you say that.
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
03 Oct 2012 07:25 AM
Its a script that locks the camera VIA LocalScript, you cant put a local script in the workspace.

Unless this isn't a local..
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
03 Oct 2012 07:26 AM
Step 3 You must have localscript to edit camera
Step 4 Re Drag It and put it under startergear
Report Abuse
99Nickster is not online. 99Nickster
Joined: 27 Jan 2012
Total Posts: 289
03 Oct 2012 07:26 AM
Let me explain it to you. Script1 clones Script2 into the Playergui every time the player re-spawns. Script2 locks the camera. Know what you're talking about before you say something is wrong.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
03 Oct 2012 07:30 AM
DidYouKnowYouDon'tNeedCloning!!!
Report Abuse
99Nickster is not online. 99Nickster
Joined: 27 Jan 2012
Total Posts: 289
03 Oct 2012 07:32 AM
Sometimes, the LocalScript won't run unless it's Diabled the Enabled.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
03 Oct 2012 07:33 AM
Never! Unless you is be using a weird compuper
Report Abuse
99Nickster is not online. 99Nickster
Joined: 27 Jan 2012
Total Posts: 289
03 Oct 2012 07:38 AM
You don't know what you're talking about. Go away. Sometime the LocalScrit fires to early, that's why.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
03 Oct 2012 07:40 AM
Isn't that what he wants? Make it like this:


game.Workspace.ChildAdded:connect(function(child)
wait()
if child == nil or child.Parent == nil then return end
if game.Players:GetPlayerFromCharacter(child) == nil then return end
--ThenCamera
end)
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