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: Ugh, CFrame or Body?

Previous Thread :: Next Thread 
noobkiller878 is not online. noobkiller878
Joined: 22 Dec 2008
Total Posts: 1465
02 Jun 2014 09:31 PM
Yes, I don't know what I'm doing. I'm trying to make a moving camera, yet am only to successfully move the part, yet it is facing the wrong direction... I don't know how to correct use CFrame to rotate the part to face a certain direction. Any small line to help me? I tried wiki, and it was too... Complicated. Didn't tell me what I wanted.

I know I sound like a major scrub, nub, noob, etc. I'm just tired of working on this game.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
02 Jun 2014 09:33 PM
What direction do you want to face it to?
Report Abuse
noobkiller878 is not online. noobkiller878
Joined: 22 Dec 2008
Total Posts: 1465
02 Jun 2014 09:34 PM
Well, I would like it to face 45d (left). But I'm going to be creating more than just one camera, so I was looking to find a way to do math an make it face the position it's headed to.
Report Abuse
noobkiller878 is not online. noobkiller878
Joined: 22 Dec 2008
Total Posts: 1465
02 Jun 2014 09:35 PM
Excuse me, 90d. I can't believe I had passed Geometry 2 years ago...
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
02 Jun 2014 09:36 PM
So 90 degrees counter-clockwise?

part.CFrame = part.CFrame * CFrame.Angles(0, math.pi/2, 0)
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
02 Jun 2014 09:38 PM
I like math.rad better :P

part.CFrame = part.CFrame*CFrame.Angles(0,math.rad(90),0)
--might be -90 instead of 90
Report Abuse
noobkiller878 is not online. noobkiller878
Joined: 22 Dec 2008
Total Posts: 1465
02 Jun 2014 09:38 PM
WOW... I just understood the pi reference. But would pi/2 rotate it 180?
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
02 Jun 2014 09:40 PM
math.pi

The value of π (pi). π is a mathematical constant, the ratio of the circumference of a circle to its diameter.



print( math.pi )

3.1415926535898



math.rad

math.rad (x)

Returns the angle x (given in degrees) in radians.



print( math.rad(90) )

1.5707963267949 (Which is pi/2)
Report Abuse
noobkiller878 is not online. noobkiller878
Joined: 22 Dec 2008
Total Posts: 1465
02 Jun 2014 09:47 PM
I know what pi and radials are, I took the class last semester. Forgive me, again I'm tired and didn't realize any class pass Algebra II (my school's order) was actually useful aside from getting in to a college that would financially screw me over my whole life...

... Aside from that you're right 2pi=360d and pi=180 therefore pi/2 is 90. Had to take that wheel I made in there out :D
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