|
| 10 Jul 2015 10:46 PM |
How do I do it? See, I'm saving tracks CFrames, and when it loads up, I don't want it loading up where the track used to be if the station is elsewhere. I want to save the CFrames in relation to my station, through station:GetModelCFrame()
Can I do this? |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2015 10:47 PM |
If you set the model's PrimaryPart, you can use SetPrimaryPartCFrame to CFrame the entire model relative to that part's CFrame.
|
|
|
| Report Abuse |
|
|
|
| 10 Jul 2015 10:51 PM |
The choice belongs user where to place the station. That is not an option. Plus there are several hundred tracks. I just want to "Get there CFrame in relation to the station" |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Jul 2015 10:59 PM |
| Same idea as making bricks spawn in a circle around another brick, depending on both where the brick is at and what its' current rotation. |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2015 11:13 PM |
| It's not hard, it just requires math and methods I don't know of... |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Jul 2015 12:00 AM |
You know how you can do
Vector3B - Vector3A
to get the relative vector from A-->B? You can do the same thing with CFrames, but it's more like "adding a negative" because there's no 'subtraction' in CFrames. Technically, it would be "transforming by the inverse"
So to get the relative CFrame from A-->B you do
CFrameB * CFrameA:inverse() = relativeCFrame
And then, to get the position of B when you 'load' the object:
CFrameBOfRelativeObject = CFrameA * relativeCFrame
~Upload code to codepad-dot-org with Lua syntax highlighting to preserve indentation and make it easier to read!~ |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2015 12:00 AM |
You could always rotate the brick at a point found by rotation and distance, then a. lerp it to it b. set it to it
Not sure what you are asking. |
|
|
| Report Abuse |
|
|