SameySam
|
  |
| Joined: 22 Mar 2012 |
| Total Posts: 11040 |
|
|
| 26 Dec 2016 07:42 PM |
How do I smoothly (tween) the players camera's position using a gui?
it's inside a function such as this one;
script.Parent.MouseButton1Click:connect(function() --code end)
|
|
|
| Report Abuse |
|
|
j1my3p1x
|
  |
| Joined: 16 Jan 2010 |
| Total Posts: 978 |
|
|
| 26 Dec 2016 07:43 PM |
| http://wiki.roblox.com/index.php?title=Camera_manipulation |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2016 07:47 PM |
The camera has a Tweening function. The camera type has to be scriptable in order for it to work though.
http://wiki.roblox.com/index.php?title=API:Class/Camera/Interpolate
ex: (Assuming it's a LocalScript)
local Camera = workspace.CurrentCamera Camera.CameraType = "Scriptable"
script.Parent.MouseButton1Click:connect(function() Camera:Interpolate(CFrame.new(0, 25, 0), CFrame.new(), 1) end) |
|
|
| Report Abuse |
|
|
SameySam
|
  |
| Joined: 22 Mar 2012 |
| Total Posts: 11040 |
|
|
| 26 Dec 2016 07:47 PM |
@j1
thanks that gives me a good idea of how it works.
anyone else got annythign to help?
|
|
|
| Report Abuse |
|
|
SameySam
|
  |
| Joined: 22 Mar 2012 |
| Total Posts: 11040 |
|
|
| 26 Dec 2016 07:53 PM |
@jun
and the script will know by using currentcamera to use the local players camera? (sorry ive never worked with camera's
|
|
|
| Report Abuse |
|
|
|
| 26 Dec 2016 07:55 PM |
In a localscript, yes, you can refer to workspace.CurrentCamera to manipulate the local player's camera.
|
|
|
| Report Abuse |
|
|
| |
|