Brickagon
|
  |
| Joined: 01 Jun 2015 |
| Total Posts: 366 |
|
|
| 10 Jun 2015 02:02 AM |
local Surface = Mouse.TargetSurface local Add = Vector3.FromNormalId(Surface)
local Position = Mouse.Target.Position local NewPosition = Vector3.new(Position.x + Add.x, Position.y + Add.y, Position.z + Add.z)
Basically I'm trying to get NewPosition to be 1 stud away from the surface in which I clicked. The above works ONLY when all bricks are facing their default directions, but when they are facing a different direction, it fails.
How can I make this work no matter the direction? |
|
|
| Report Abuse |
|
|
Brickagon
|
  |
| Joined: 01 Jun 2015 |
| Total Posts: 366 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 10 Jun 2015 03:15 AM |
| CF * CF (or * V3 to get a V3 returned) |
|
|
| Report Abuse |
|
|
Brickagon
|
  |
| Joined: 01 Jun 2015 |
| Total Posts: 366 |
|
|
| 10 Jun 2015 01:07 PM |
Elaborate please.
local Coord = Mouse.Target.CFrame local NewPosition = Vector3.new(Position.x + Add.x, Position.y + Add.y, Position.z + Add.z)
What am I multiplying together? Coord and NewPosition? It doesn't matter whether I get a CFrame or Vector3 returned. |
|
|
| Report Abuse |
|
|
Brickagon
|
  |
| Joined: 01 Jun 2015 |
| Total Posts: 366 |
|
|
| 10 Jun 2015 01:27 PM |
Got it working. Multiply the rotated block's CFrame by the NormalId Vector |
|
|
| Report Abuse |
|
|