|
| 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
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 02 Jun 2014 09:33 PM |
| What direction do you want to face it to? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 02 Jun 2014 09:35 PM |
| Excuse me, 90d. I can't believe I had passed Geometry 2 years ago... |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 02 Jun 2014 09:38 PM |
| WOW... I just understood the pi reference. But would pi/2 rotate it 180? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|