ZizZazZuz
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
|
| 07 Mar 2012 03:37 PM |
| I have a brick that is pointing slightly up. How do I get it's lookVector not to point up, but keep the other two axis? |
|
|
| Report Abuse |
|
|
|
| 07 Mar 2012 03:46 PM |
So basically you want the 2 of the axises to stay the same, but one to change to an angle that would make the bricks flat?
|
|
|
| Report Abuse |
|
|
ZizZazZuz
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
| |
|
|
| 07 Mar 2012 03:54 PM |
Depends on the bricks CFrame really.
Y axis is typically it's spinning rotation(given the top surface it facing up, and the front surface is facing forward)
X axis is typically it's Left and Right rotation(given the top surface it facing up, and the front surface is facing forward)
Z axis is typically it's Front and Back rotation (given the top surface it facing up, and the front surface is facing forward)
Really you just have to mess with it, That code I have you in the other forum post can be modified to make your problem work, it just takes some tweaking in the CFrame part of the script. |
|
|
| Report Abuse |
|
|
ZizZazZuz
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
|
| 07 Mar 2012 04:00 PM |
| Say the front face is facing up. I want the lookVector, and I want to cancel out the X/Y/Z axis, depending on which is making it look up. |
|
|
| Report Abuse |
|
|
|
| 07 Mar 2012 04:05 PM |
part = YourPartHere
local AxisX = (Vector3.new(part.CFrame:toEulerAnglesXYZ()).x) local AxisY = (Vector3.new(part.CFrame:toEulerAnglesXYZ()).y) local AxisZ = (Vector3.new(part.CFrame:toEulerAnglesXYZ()).z) part.CFrame = part.CFrame.LookVector * CFrame.Angles(0,0,-Axis)
TBH I dont know if it will work, but im fairly confident the Z axis is going to typically be the bricks up down rotation(as long as you keep in mind what i said in my last post)
Like I said, just mess with it, I have you access to the 3 rotation axis parts of the part, just see what works.
|
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
ZizZazZuz
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
|
| 07 Mar 2012 04:24 PM |
It's not 'looking at' anything. It's just rotated. I just want to make something like:
lookVector * Vector3.new(1 or 0, 1 or 0, 1 or 0)
1 is for ones that are not making it point up (Should be two numbers), 0 is for the one that is. |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|