|
| 29 Dec 2013 09:23 PM |
| I am trying to check if a brick is facing up or not. I've tried using CFrame.Angles but have not succeeded. By "up" I mean if it's topsurface is facing up. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 29 Dec 2013 09:25 PM |
the top surface or front surface?
You could just check the rotation property, as an easy way. Or using asin |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
| |
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
| |
|
|
| 29 Dec 2013 09:29 PM |
| I think he's trying to make a stabilizer maybe? |
|
|
| Report Abuse |
|
|
|
| 29 Dec 2013 11:00 PM |
| Sorry, I'm having a lot of trouble with this. I know how to check the rotation property, but I have a large number of bricks that I'm trying to change. I want to make sure each and every one of them face up, and as I individually look at each of them their rotations vary. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 29 Dec 2013 11:03 PM |
| Just check the rotation on the X and Z axes |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2013 10:45 AM |
| Thank you, that worked. I have another problem. I change the X and Z axes to 0 to get the top to face up, but then previous rotations are eliminated; as if the brick goes back to the grid. Rotation that I want to change changes correctly, but then, I don't know how to explain it, the fromEulerAnglesXYZ(_,This_Rotation,_) is set back to the grid, although I want the brick to stay rotated that way. How do I fix this? |
|
|
| Report Abuse |
|
|
Milkilla
|
  |
| Joined: 01 Sep 2011 |
| Total Posts: 379 |
|
|
| 30 Dec 2013 10:46 AM |
| change the surface to weld |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2013 11:14 AM |
| This has nothing to do with welding; all of the bricks are anchored, and this is done through the command bar. |
|
|
| Report Abuse |
|
|
Nyxis
|
  |
| Joined: 15 Nov 2012 |
| Total Posts: 3374 |
|
|
| 30 Dec 2013 11:16 AM |
| I think it would have something to do with CFrame.lookVector |
|
|
| Report Abuse |
|
|
StBashkir
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26171 |
|
|
| 30 Dec 2013 11:30 AM |
| I believe what is happening is an internal attempt at fixing Gimbal Lock, which occurs when using Euler's angles. Google Gimbal Lock |
|
|
| Report Abuse |
|
|