|
| 21 Jun 2014 01:07 AM |
I have two bricks: Part1 and Part2
I want Part2 to be at the same CFrame it was around Part1 as it was before rotated/moved.
For example, say I rotated Part1 which Part2 was on its front. I want Part2 to go into the same orientation as it was previously and be on the same side.
Is this possible? |
|
|
| Report Abuse |
|
|
jasondee1
|
  |
| Joined: 26 Jul 2008 |
| Total Posts: 8002 |
|
|
| 21 Jun 2014 01:10 AM |
while true do wait(1) Part1 = game.Workspace.Part1 Part2 = game.Workspace.Part2 Part1.CFrame = CFrame.new(Part2.Position) end
something like that |
|
|
| Report Abuse |
|
|
|
| 21 Jun 2014 01:12 AM |
| That would just set the CFrame of Part1 to the position of Part2.. |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
|
| 21 Jun 2014 01:14 AM |
First off, Scripting Helpers.
Secondly, you're being very vague, and half of what you say doesn't make sense.
Either you're asking for: local dif = A.CFrame:toObjectSpace(B.CFrame) A.CFrame = A.CFrame * ? -- change A CFrame B.CFrame = A.CFrame * dif
Or you're asking for: local dif = A.CFrame:pointToObjectSpace(B.Position) A.CFrame = A.CFrame * ? -- change A CFrame B.CFrame = (B.CFrame - B.CFrame.p) + A.CFrame * dif |
|
|
| Report Abuse |
|
|
|
| 21 Jun 2014 01:19 AM |
Shoot. I'm terribly sorry about that - I was in Scripting Helpers then hit backspace by accident which led me back to the main forum page. I must have quickly looked and thought I clicked Scripting Helpers.
I'm terribly sorry for my mistake..
It's a bit difficult to explain what I'm looking for.
Sorry, and thanks Oysi! |
|
|
| Report Abuse |
|
|
|
| 21 Jun 2014 01:20 AM |
Now I realize why I thought this was Scripting Helpers.. wth has this forum come to with all the spam...
Sorry, and thanks again Oysi! |
|
|
| Report Abuse |
|
|
|
| 21 Jun 2014 01:22 AM |
This belongs in the Scripting Helpers subforum.
part1 = part part2 = part2 c1 = part1.CFrame c2 = part2.CFrame while wait() do Offset = Vector3.new(c1.p-c2.p) p2.CFrame = p1.CFrame +Offset end Could make better, but i typed this on a 3DS. |
|
|
| Report Abuse |
|
|