Zerio920
|
  |
| Joined: 06 Apr 2012 |
| Total Posts: 3311 |
|
|
| 01 Aug 2014 06:59 PM |
| How would I make a brick move, say, 5 studs from another brick? The bricks are both rotating so it seems a little tricky. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 01 Aug 2014 07:02 PM |
5 studs in which brick's direction? The first one's right or? |
|
|
| Report Abuse |
|
|
Zerio920
|
  |
| Joined: 06 Apr 2012 |
| Total Posts: 3311 |
|
|
| 01 Aug 2014 07:05 PM |
| 5 studs away from it. Since they rotate the axis that it would move would change. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 01 Aug 2014 07:07 PM |
Okay, but what direction? Away from it doesn't mean anything, 5 studs in any direction is essentially moving it away from the other part. |
|
|
| Report Abuse |
|
|
Zerio920
|
  |
| Joined: 06 Apr 2012 |
| Total Posts: 3311 |
|
|
| 01 Aug 2014 07:10 PM |
| Let's say 5 studs away from the back surface. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 01 Aug 2014 07:11 PM |
| part2.CFrame = part1.CFrame * CFrame.new(0, 0, 5 + (part1.Size.Z / 2)); |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2014 07:13 PM |
amount = 5 -- Studs to move. axis = "y" -- x, y, or z p1 = game.Workspace.Part1 p2 = game.Workspace.Part2
if axis == "x" then p2.Position = Vector3.new(p1.Position.x+amount, p1.Position.y, p1,Position.z) end
if axis == "y" then p2.Position = Vector3.new(p1.Position.x, p1.Position.y+amount, p1,Position.z) end
if axis == "z" then p2.Position = Vector3.new(p1.Position.x, p1.Position.y, p1,Position.z+amount) end |
|
|
| Report Abuse |
|
|
Zerio920
|
  |
| Joined: 06 Apr 2012 |
| Total Posts: 3311 |
|
|
| 01 Aug 2014 07:20 PM |
| @cntkillme: Thx, why is Size in there though since this is just the brick moving? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 01 Aug 2014 07:22 PM |
Well you said 5 studs from the back surface, not the center of the brick so yeah. If you meant 5 studs from the brick in general, just remove the addition |
|
|
| Report Abuse |
|
|