|
| 25 Jul 2013 10:17 AM |
I've been trying to make it so that it rotates around an object when you first enter or respawn (like at Washington DC). I've had no luck getting the camera to return to its original settings, so that the play can once again control it, nor have I been able to make it rotate successfully, as CFraming/angles aren't my strong point. Most of this is from the wiki. ------------- local target = game.Workspace.special local camera = game.Workspace.CurrentCamera camera.CameraSubject = target camera.CameraType = "Fixed" local angle = 0 while wait() 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, 0) --Move the camera backwards _ units angle = angle + math.rad(1) end
function click() game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid game.Workspace.CurrentCamera.CameraType = "Custom" end
script.Parent.ScreenGui.Play.MouseButton1Down:connect(click) |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 10:18 AM |
so that the player can once again control it* sorry for my spelling errors |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 10:18 AM |
| You have to break your loop function. |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 10:27 AM |
| When I try to make things orbit, I usually use lookVector that gets affected by rotation to its cframe. |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 10:29 AM |
And how would I break my loop function? (I only want it to break when someone presses the play button).
~RAT is a clan, now get in my van. ® |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 25 Jul 2013 10:30 AM |
break
while true do break end print("HI") >HI
YAY NO GAME FROZEN! |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 10:30 AM |
Also, another problem I'm having is that the Camera isn't looking AT the part, it's doing the opposite. What can I do to make it FACE the part?
~RAT is a clan, now get in my van. ® |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 10:31 AM |
@cnt I ONLY want it to break when someone presses a button.
~RAT is a clan, now get in my van. ® |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 25 Jul 2013 10:33 AM |
local click = false
Button.MouseButton1Down:connect(function() click = true end)
while ture do if click break else lololol end end |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 10:43 AM |
do i put the main script where lolololol is?
~RAT is a clan, now get in my van. ® |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 10:45 AM |
my mind isn't working today extra help needed
~RAT is a clan, now get in my van. ® |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 25 Jul 2013 10:45 AM |
| yup, don't forget to add a wait |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 11:02 AM |
After the 'break end', the else gives me an error. It says: 'end' expected (to close 'while' at line 13 near 'else'.
I'm not missing any 'end's, am I? --------------------------------------------------------- local target = game.Workspace.special local camera = game.Workspace.CurrentCamera camera.CameraSubject = target camera.CameraType = "Fixed" local angle = 0 local button = script.Parent.ScreenGui.Play local click = false
button.MouseButton1Down:connect(function() click = true end)
while true do wait(0.1) if click then break end else while wait() 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, 0) --Move the camera backwards ,,_ units angle = angle + math.rad(1) end end
function click() game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid game.Workspace.CurrentCamera.CameraType = "Custom" end
script.Parent.ScreenGui.Play.MouseButton1Down:connect(click) |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 11:08 AM |
mind still not working even more help needed
~RAT is a clan, now get in my van. ® |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 11:11 AM |
cntkillme where are you!?!?! :(
~RAT is a clan, now get in my van. ® |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 25 Jul 2013 11:13 AM |
look above i get an error at 'else'
~RAT is a clan, now get in my van. ® |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 25 Jul 2013 11:13 AM |
| Tab the script and see if ends are mismatched |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 11:18 AM |
Nothing is mismatched...
~RAT is a clan, now get in my van. ® |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 25 Jul 2013 11:19 AM |
Whatever this error is, it breaks the entire script. Is it because I have while true do and then while wait() do?
~RAT is a clan, now get in my van. ® |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 11:20 AM |
The exact output is this: 12:19:46.965 - Players.Player1.PlayerGui.LocalScript:18: 'end' expected (to close 'while' at line 13) near 'else'
~RAT is a clan, now get in my van. ® |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 25 Jul 2013 11:26 AM |
I rewrote the entire thing using the auto tab and it still errors.
~RAT is a clan, now get in my van. ® |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 11:28 AM |
This is the strangest error I've ever seen. The funny thing is if a put any random crap at the top of the script, the 'else' stops erroring.
~RAT is a clan, now get in my van. ® |
|
|
| Report Abuse |
|
|