generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Why does this stop?

Previous Thread :: Next Thread 
FoggedOut is not online. 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 is not online. FoggedOut
Joined: 09 Dec 2011
Total Posts: 3021
16 Aug 2013 09:35 PM
Bump
Report Abuse
FoggedOut is not online. FoggedOut
Joined: 09 Dec 2011
Total Posts: 3021
16 Aug 2013 09:39 PM
Bump2
Report Abuse
FoggedOut is not online. FoggedOut
Joined: 09 Dec 2011
Total Posts: 3021
16 Aug 2013 09:43 PM
Bump3 qq Help plz
Report Abuse
FoggedOut is not online. FoggedOut
Joined: 09 Dec 2011
Total Posts: 3021
16 Aug 2013 09:48 PM
qq
Report Abuse
laughablehaha is not online. laughablehaha
Joined: 19 Apr 2012
Total Posts: 2495
16 Aug 2013 10:41 PM
You probably need to make a "for" loop for the rotation.
Report Abuse
FoggedOut is not online. 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 is not online. FoggedOut
Joined: 09 Dec 2011
Total Posts: 3021
17 Aug 2013 03:37 PM
Bump
Report Abuse
miz656 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
17 Aug 2013 04:13 PM
This is in a localscript, correct?
Report Abuse
FoggedOut is not online. 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 is not online. 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 is not online. FoggedOut
Joined: 09 Dec 2011
Total Posts: 3021
17 Aug 2013 04:52 PM
Uh......No? XD
Report Abuse
miz656 is not online. 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 is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image