Foxconn
|
  |
| Joined: 20 Feb 2011 |
| Total Posts: 275 |
|
|
| 21 Jan 2014 09:50 PM |
First of all, why does it have to be an Enum.Axis? Secondly, how to I make the Enum.Axis equal the axis (or axes[plural]) of a brick?
-I need to get a brick to stay locked to a movable and rotatable axis, also called an origin. |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2014 09:56 PM |
Was FromAxis added recently (to the wiki or in general), or did I just skip over it while reading docs?
Anyways, it has to be an axis enum because there are only certain axes, and it doesn't make sense to not have it be an enum. You can't get the relative axis of a part using this, but you can using CFrames.
~LuaWeaver; Programmer, gamer, developer. |
|
|
| Report Abuse |
|
|
Foxconn
|
  |
| Joined: 20 Feb 2011 |
| Total Posts: 275 |
|
|
| 21 Jan 2014 10:43 PM |
Okay, but say I have one anchored brick and one not anchored, and I want the one that isn't anchored to stay fixed to the Y axis of the anchored brick. How would I go about doing that? I have found how to get them to have the exact same rotation, all I need now is to get the one that isn't anchored to move to a spherical location around the anchored part depending on its angle.
Here's the code I came up with:
local A = script.Parent.Align local T = script.Parent.Target
A.CFrame=T.CFrame*CFrame.fromAxisAngle(T.CFrame.lookVector,2*math.pi) |
|
|
| Report Abuse |
|
|
Foxconn
|
  |
| Joined: 20 Feb 2011 |
| Total Posts: 275 |
|
|
| 21 Jan 2014 10:59 PM |
| Nevermind that code, it does the same as A.CFrame=T.CFrame |
|
|
| Report Abuse |
|
|