Evetor
|
  |
| Joined: 04 Mar 2013 |
| Total Posts: 4217 |
|
|
| 25 Jun 2014 04:10 PM |
Let's say I have a part at (10,1,0)
This part is facing towards an unusual direction
How do I define a Vector3 position 5 studs in front of the part? |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2014 04:12 PM |
| newCFrame=part.CFrame.lookVector*5 |
|
|
| Report Abuse |
|
|
Evetor
|
  |
| Joined: 04 Mar 2013 |
| Total Posts: 4217 |
|
|
| 25 Jun 2014 04:15 PM |
| So the position would be CFrame.p? |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2014 04:15 PM |
newCFrame=part.CFrame.lookVector*5
print(newCFrame) print(Vector3.new(newCFrame))
Idk how to explain to you that newCFrame is a position. |
|
|
| Report Abuse |
|
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 25 Jun 2014 04:26 PM |
newCFrame=part.CFrame.lookVector*5
That would move the part to 5 studs away from the origin (0,0,0)
Use:
newCFrame= part.CFrame * CFrame.new(0,0,-5)
or if you must use lookVector:
newCFrame = part.CFrame.lookVector *5 + the_bricks_current_position |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2014 04:28 PM |
| What do you mean? It would move it 5 studs in front of the part in the direction of the lookVector. |
|
|
| Report Abuse |
|
|