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
 

go to camera subject when button is clicked

Previous Thread :: Next Thread 
Alimegacorn is not online. Alimegacorn
Joined: 24 May 2013
Total Posts: 899
23 Apr 2016 07:01 PM
local target = workspace.Camerapart
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = target

function onClick()
camera.CoordinateFrame = CFrame.new(target.Position)
CFrame.new(10, 10, 10)
end

script.Parent.MouseButton1Click:connect(onClick)
Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
23 Apr 2016 07:09 PM
"CFrame.new(10, 10, 10)"

You have this in the middle of no where, why?



Report Abuse
Alimegacorn is not online. Alimegacorn
Joined: 24 May 2013
Total Posts: 899
23 Apr 2016 07:16 PM
i have no idea
lol
i'll try removing that
Report Abuse
Alimegacorn is not online. Alimegacorn
Joined: 24 May 2013
Total Posts: 899
23 Apr 2016 07:17 PM
aand that doesnt work
Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
23 Apr 2016 07:21 PM
>make sure it's a local script.

local part = game.Workspace.Camerapart
local camera = game.Workspace.CurrentCamera

camera.CameraType = Enum.CameraType.Scriptable

function onclick()
camera.CFrame = CFrame.new(part.Position)
end
script.Parent.MouseButton1Down:connect(onclick)



Report Abuse
Alimegacorn is not online. Alimegacorn
Joined: 24 May 2013
Total Posts: 899
23 Apr 2016 07:28 PM
put it into a localscript
and didnt work

gg
Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
23 Apr 2016 07:31 PM
This works, actually tested it.
#code
wait(2)
local p = game.Workspace.Part
local c = game.Workspace.CurrentCamera
local b = script.Parent
function look()
c.CameraType = Enum.CameraType.Scriptable
c.CFrame = CFrame.new(p.Position)
end
b.MouseButton1Down:connect(look)



Report Abuse
Alimegacorn is not online. Alimegacorn
Joined: 24 May 2013
Total Posts: 899
23 Apr 2016 07:37 PM
for some weird reason it doesnt work
heres what i have

StarterGui
ScreenGui
TextButton
LocalScript

LocalScript:

Your script you posted
Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
23 Apr 2016 07:38 PM
Is your script disabled or something?



Report Abuse
Alimegacorn is not online. Alimegacorn
Joined: 24 May 2013
Total Posts: 899
23 Apr 2016 07:41 PM
lmao it was

gg
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
23 Apr 2016 07:56 PM
lmao ur dumb
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