FoggedOut
|
  |
| Joined: 09 Dec 2011 |
| Total Posts: 3021 |
|
|
| 16 Aug 2013 09:31 PM |
I want my Camera to Rotate on the X-Axis, and move down 15 on the Y-Axis. It moves down, and can rotate but it doesn't keep rotating!? It stops when it gets to the side of me, so please help me. qq
Script: target = workspace.Part.Position c = workspace.CurrentCamera c.CameraType = "Scriptable" Pos = Vector3.new(0, 50, -50) Xaxis = 0 Zoom = 70 a = 0
while wait() do c.FieldOfView = Zoom Zoom = 40 Xaxis = Xaxis +3 Pos = Vector3.new(Xaxis, 35, -50) <-- Here is where it makes the thing move c.CoordinateFrame = CFrame.new(Pos,target) end |
|
|
| Report Abuse |
|
|
FoggedOut
|
  |
| Joined: 09 Dec 2011 |
| Total Posts: 3021 |
|
| |
|
FoggedOut
|
  |
| Joined: 09 Dec 2011 |
| Total Posts: 3021 |
|
| |
|
FoggedOut
|
  |
| Joined: 09 Dec 2011 |
| Total Posts: 3021 |
|
| |
|
FoggedOut
|
  |
| Joined: 09 Dec 2011 |
| Total Posts: 3021 |
|
| |
|
|
| 16 Aug 2013 10:41 PM |
| You probably need to make a "for" loop for the rotation. |
|
|
| Report Abuse |
|
|
FoggedOut
|
  |
| Joined: 09 Dec 2011 |
| Total Posts: 3021 |
|
|
| 16 Aug 2013 11:11 PM |
| If I did a 'for', it would have to stop at one point. I want it to go on going because I have a GUI Button (Play Button) to stop it from rotating. |
|
|
| Report Abuse |
|
|
FoggedOut
|
  |
| Joined: 09 Dec 2011 |
| Total Posts: 3021 |
|
| |
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 17 Aug 2013 03:59 PM |
hi. First of all, I must comment about your global variables. You have 6 global variables you use and only access them once. If you want to look for optimizations (changes to make the script more efficient), I recommend you don't use global variables unless you use them multiple times. That or make them local inside the scope.
"I want my Camera to Rotate on the X-Axis, and move down 15 on the Y-Axis. It moves down, and can rotate but it doesn't keep rotating!? It stops when it gets to the side of me, so please help me. qq"
Do you want it to rotate and move down at the same time or rotate firs then move down 15 times?
|
|
|
| Report Abuse |
|
|
FoggedOut
|
  |
| Joined: 09 Dec 2011 |
| Total Posts: 3021 |
|
|
| 17 Aug 2013 04:02 PM |
| I just want the Camera to Rotate on the X-Axis (SideWays) forever in this script. I have a play Button that will stop the Spinning, so don't worry about stopping it. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 17 Aug 2013 04:08 PM |
for i = 1,math.huge do c.FieldOfView = Zoom c.CoordinateFrame = CFrame.new(i,0,0) wait(.1) end
just put your variables in and try that out. Not 100% sure because I didn't test and I haven't worked with camera manipulation in a while so...yeah :P |
|
|
| Report Abuse |
|
|
FoggedOut
|
  |
| Joined: 09 Dec 2011 |
| Total Posts: 3021 |
|
|
| 17 Aug 2013 04:11 PM |
| It works, it's just that it does exactly the same thing as my old script did. It goes to my Left Arm, and stops when facing it. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 17 Aug 2013 04:13 PM |
| This is in a localscript, correct? |
|
|
| Report Abuse |
|
|
FoggedOut
|
  |
| Joined: 09 Dec 2011 |
| Total Posts: 3021 |
|
|
| 17 Aug 2013 04:26 PM |
| Correct, it is. Its also in StarterGui FYI. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 17 Aug 2013 04:48 PM |
| and you Did add a wait function at the top so it can load, right? |
|
|
| Report Abuse |
|
|
FoggedOut
|
  |
| Joined: 09 Dec 2011 |
| Total Posts: 3021 |
|
| |
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 17 Aug 2013 04:55 PM |
| This probably won't fix the problem but add a wait(.1) at the top of the localscript. |
|
|
| Report Abuse |
|
|
FoggedOut
|
  |
| Joined: 09 Dec 2011 |
| Total Posts: 3021 |
|
|
| 17 Aug 2013 05:01 PM |
| Ok, I can try. I just don't get why it wont keep rotating around.... Hm, I'll have to think about it more. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 17 Aug 2013 05:02 PM |
| Any errors? Did you try pcalling the thread? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 17 Aug 2013 05:04 PM |
| ypcall if you have the wait(0.1) in itqq |
|
|
| Report Abuse |
|
|