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
 

Help with LocalCamera

Previous Thread :: Next Thread 
noobkiller3759 is not online. noobkiller3759
Joined: 04 Feb 2010
Total Posts: 85
07 May 2013 11:35 AM
I want to use LocalScript to onEquip tool do something with the CurrentCamera. On unequipp, center it back to the player.
PROBLEM 1: CoordinateFrame works fine, but Focus doesn't work. It still focuses "somewhere". No matter what positions I write.
PROBLEM 2: I don't know how to center it back to the player. Please help.
CODE:
local camera = workspace.CurrentCamera -- get the camera

function unequipp(mouse)
--get player and center the camera

end

function equipp(mouse)
camera.CameraType = "Scriptable" --to stop player manipulating
camera.CoordinateFrame = CFrame.new(17,30,0) -- works fine
x = game.Workspace.CesiSpawn.Position.X --CesiSpawn is a part in the Workspace
y = game.Workspace.CesiSpawn.Position.Y
z = game.Workspace.CesiSpawn.Position.Z
print(workspace.CurrentCamera.Focus) -- debug
camera.Focus = CFrame.new(x,y,z)
print(workspace.CurrentCamera.Focus) -- focus "changed" but Camera still not pointing to the CesiSpawn Part
end


script.Parent.Parent.Unequipped:connect(unequipp) --calling
script.Parent.Parent.Equipped:connect(equipp)

-------------------------------------------------------------------------------------------------------
Code end
Report Abuse
noobkiller3759 is not online. noobkiller3759
Joined: 04 Feb 2010
Total Posts: 85
07 May 2013 11:52 AM
Problem 2 solved
Report Abuse
noobkiller3759 is not online. noobkiller3759
Joined: 04 Feb 2010
Total Posts: 85
08 May 2013 12:50 AM
Bump
Report Abuse
noobkiller3759 is not online. noobkiller3759
Joined: 04 Feb 2010
Total Posts: 85
16 May 2013 02:14 PM
Ok done now only one problem - doesn't work in Online,
Report Abuse
zars15 is not online. zars15
Joined: 10 Nov 2008
Total Posts: 9999
16 May 2013 02:28 PM
Make sure you are using local script and if it's still not working, add wait() at beginning of it.
Report Abuse
NOWAYOUT2 is not online. NOWAYOUT2
Joined: 24 Jul 2011
Total Posts: 5556
16 May 2013 02:59 PM
I agree with zars...
Because he's clearly better than me at scripting...

[~Achievement Unlocked~]
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