chloeb1
|
  |
| Joined: 28 Sep 2012 |
| Total Posts: 2460 |
|
|
| 29 Sep 2017 01:25 PM |
I have made it so it rotates around a part when they join (pretty easy I know..) but I want it so when you click a TextButton it will stop. However just using what is below doesn't work (when in a MouseButton1Click function).
game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid game.Workspace.CurrentCamera.CameraType = "Custom"
You should know the camera rotation script, if you don't just reply. Thanks.
#code print("this is secretly a bump") |
|
|
| Report Abuse |
|
|
chloeb1
|
  |
| Joined: 28 Sep 2012 |
| Total Posts: 2460 |
|
|
| 30 Sep 2017 01:38 AM |
b
#code print("this is secretly a bump") |
|
|
| Report Abuse |
|
|
|
| 30 Sep 2017 01:49 AM |
Any errors ?
Lua is my moon, Java is my coffee, Pascal is my dad, C++ is my grade 😎😎😎 |
|
|
| Report Abuse |
|
|
chloeb1
|
  |
| Joined: 28 Sep 2012 |
| Total Posts: 2460 |
|
|
| 30 Sep 2017 01:52 AM |
No apparently there is none :/
#code print("this is secretly a bump") |
|
|
| Report Abuse |
|
|
|
| 30 Sep 2017 01:57 AM |
| what are you using to make it rotate around a part? post source code |
|
|
| Report Abuse |
|
|
chloeb1
|
  |
| Joined: 28 Sep 2012 |
| Total Posts: 2460 |
|
|
| 30 Sep 2017 02:04 AM |
In local script:
local target = workspace.Part local camera = workspace.CurrentCamera camera.CameraType = Enum.CameraType.Scriptable camera.CameraSubject = target local angle = 0 while true do camera.CoordinateFrame = CFrame.new(target.Position) --Start at the position of the part * CFrame.Angles(0, angle, 0) --Rotate by the angle * CFrame.new(0, 0, 5) --Move the camera backwards 5 units angle = angle + math.rad(1) end
#code print("this is secretly a bump") |
|
|
| Report Abuse |
|
|
chloeb1
|
  |
| Joined: 28 Sep 2012 |
| Total Posts: 2460 |
|
|
| 30 Sep 2017 02:06 AM |
And yes there is only one part named "part"
#code print("this is secretly a bump") |
|
|
| Report Abuse |
|
|
chloeb1
|
  |
| Joined: 28 Sep 2012 |
| Total Posts: 2460 |
|
|
| 30 Sep 2017 02:08 AM |
(I found this on the wiki, that's why there are comments; I'm using this because my other one was buggy)
*And I meant "Part" not "part"
#code print("this is secretly a bump") |
|
|
| Report Abuse |
|
|
|
| 30 Sep 2017 03:15 AM |
So it should stop rotating when you click on a TextButton?
Just make a event with TextButton.MouseButton1Down:Connect(function ()
end) inside the while true do loop and when it got clicked break the loop so:
TextButton.MouseButton1Down:Connect(function () break end)
I'm not sure if that works but it's something like that |
|
|
| Report Abuse |
|
|
chloeb1
|
  |
| Joined: 28 Sep 2012 |
| Total Posts: 2460 |
|
|
| 30 Sep 2017 03:17 AM |
I'll try it thanks Hexagon.
#code print("this is secretly a bump") |
|
|
| Report Abuse |
|
|
|
| 30 Sep 2017 05:49 AM |
local target = workspace.Part local camera = workspace.CurrentCamera camera.CameraType = Enum.CameraType.Scriptable camera.CameraSubject = target local angle = 0 camerarot = game:service'RunService'.RenderStepped:connect(function() camera.CoordinateFrame = CFrame.new(target.Position) --Start at the position of the part * CFrame.Angles(0, angle, 0) --Rotate by the angle * CFrame.new(0, 0, 5) --Move the camera backwards 5 units angle = angle + math.rad(1) end)
--in the mousebutton1down
camerarot:disconnect() |
|
|
| Report Abuse |
|
|
chloeb1
|
  |
| Joined: 28 Sep 2012 |
| Total Posts: 2460 |
|
|
| 30 Sep 2017 05:50 AM |
okay thanks
#code print("this is secretly a bump") |
|
|
| Report Abuse |
|
|