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: How do you focus on a part with a SurfaceGui?

Previous Thread :: Next Thread 
jager72 is not online. jager72
Joined: 14 Aug 2010
Total Posts: 11034
30 Apr 2016 09:12 PM
Here is my current script:


tb = script.Parent.TextButton
tb.MouseButton1Down:connect(function()
cam = game.workspace.CurrentCamera:clone()
cam.Parent = game.Workspace
cam.CameraType = "Watch"
game.workspace.CurrentCamera.CameraSubject = script.Parent.Parent
game.workspace.CurrentCameraFieldOfView = 20
wait(3)
cam.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
cam.FieldOfView = 70
game.Workspace.CurrentCamera.CameraSubject=game.Players.LocalPlayer.Character.Humanoid
game.Workspace.CurrentCamera:Remove()
game.Workspace.CurrentCamera = cam
end)


The idea is that the camera focuses on the part for 3 seconds when the TextButton is clicked and then returns to the player's camera. This script is not working. How would I fix this?
Report Abuse
jager72 is not online. jager72
Joined: 14 Aug 2010
Total Posts: 11034
30 Apr 2016 10:10 PM
No one?
Report Abuse
dave2011 is not online. dave2011
Joined: 02 Oct 2010
Total Posts: 10581
30 Apr 2016 10:24 PM
I dont think you can just set their camera like that lol
game.Workspace.CurrentCamera = cam


Report Abuse
jager72 is not online. jager72
Joined: 14 Aug 2010
Total Posts: 11034
30 Apr 2016 10:26 PM
Ok, what would be the correct way?
Report Abuse
dave2011 is not online. dave2011
Joined: 02 Oct 2010
Total Posts: 10581
30 Apr 2016 10:27 PM
manipulate their camera and then set it back to the default whatever that is, without cloning the camera, just use the currentcamera


Report Abuse
jager72 is not online. jager72
Joined: 14 Aug 2010
Total Posts: 11034
30 Apr 2016 10:33 PM
But how would I actually script it so that the camera is focused on the part?
Report Abuse
scottmike0 is not online. scottmike0
Joined: 14 Sep 2008
Total Posts: 1073
30 Apr 2016 11:46 PM
camera has properties to ya know.
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