I had an idea where I could use a GUI to move the camera around a menu screen. So when I press about, The camera would move towards the point where the about point would be. however I have no clue how to move the camera from point A to Point B. I know how to set them, just not move them. I do however have a feeling that I'm supposed to use loops to move the camera around. I have placed the GUI's down just not set them yet in the script, I do know how to set them. Here is what I have: (This is in a Local Script)
01 | local Menupos = workspace.Menu.PMenu.Position |
02 | local Aboutpos = workspace.Menu.PAbout.Position |
03 | local Playpos = workspace.Menu.PPlay.Position |
04 | local Lookpos = workspace.Menu.LookC.Position |
05 |
06 | -------------------------//Main Script\\-------(There is where stuff happens!)----------------------------------- |
07 | -----//Varialbes// |
08 |
09 | plr = game.Players.LocalPlayer |
10 | cam = game.Workspace.CurrentCamera |
11 | cam.CameraType = Enum.CameraType.Scriptable |
12 | chr = nil |
13 |
14 | Menu = game.Workspace.Menu.PMenu |
15 | About = game.Workspace.Menu.PAbout |
So would you need like a for loop to move the CoordinateFrame using +0.1 or something?
Using loops is plausible, but it's very long and tedious, not to mention inefficient. Check out the Interpolate method of the camera. It basically tweens the camera to the position
You can set where the camera will be by the end of the interpolation, how long it'll take to do it, and where it'll end up looking at. It's a very smooth transition.
http://wiki.roblox.com/index.php?title=API:Class/Camera/Interpolate
Obviously you need to set the camera type to Scriptable.