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: Lock first-person when the camera is attached to a brick?

Previous Thread :: Next Thread 
Jarod645 is not online. Jarod645
Joined: 30 Jun 2008
Total Posts: 56
11 May 2014 11:51 AM
Hello everyone,
I've been working on a script for a vehicle of mine, and I need to lock the player into first-person when a button is pressed. I've tried several methods, including CameraMaxZoomDistance and Enum.CameraMode.LockFirstPerson, but nothing seems to be working. I think the problem might be that I'm attaching the camera to a brick, and the properties that would allow me to lock first person aren't working properly because of that. Does anybody know how I can make this work?
Sincerely,
Jarod645
Report Abuse
Jarod645 is not online. Jarod645
Joined: 30 Jun 2008
Total Posts: 56
11 May 2014 12:31 PM
Bump'd
Report Abuse
ColdSmoke is not online. ColdSmoke
Joined: 02 Jan 2012
Total Posts: 5784
11 May 2014 12:34 PM
put this in a localscript

game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson

It will only work in a localscript
Report Abuse
Jarod645 is not online. Jarod645
Joined: 30 Jun 2008
Total Posts: 56
11 May 2014 01:20 PM
Nope, that didn't work. Any other suggestions?
Report Abuse
ColdSmoke is not online. ColdSmoke
Joined: 02 Jan 2012
Total Posts: 5784
11 May 2014 01:21 PM
It works great for me, is there an output? did you actually put it in a localscript?
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
11 May 2014 01:26 PM
--local script inside backpack

game.Workspace.CurrentCamera.CameraType = "LockFirstPerson"

--or maybe it was this, try both,

game.Workspace.CurrentCamera.CameraType = "Lock First Person"
Report Abuse
Jarod645 is not online. Jarod645
Joined: 30 Jun 2008
Total Posts: 56
11 May 2014 02:06 PM
Apologies for the late reply, I've been meeting with someone.
The script is given to the player via a GUI given when said player sits on a certain seat.
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