|
| 27 Jul 2016 02:12 AM |
If I set a BodyVelocity's Velocity to the look Vectors of a brick, will it move forward or in the direction if the front of the brick?
Example
BodyVelocity.Velocity = Vector3.new(Part.CFrame.LookVector)
Will that move the brick forward? |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2016 02:13 AM |
lookVector is a Unit Vector, why the heck would you make a Vector3 using something that already is a Vector3?
lookVector is 1 stud in the direction the part is facing. |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2016 02:14 AM |
| So no. Thats all I needed, thank you. |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2016 02:15 AM |
| You have to btw. You will get an error. How long have you been using lua :/ |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2016 02:17 AM |
Here is the thing.
Part.CFrame.lookVector is the direction that the brick is facing.
It is measured in 1 STUD
Say a brick was aiming to the left
lookVector would be: {1,0,0} because 1 stud in the direction it is looking will be on the X axis.
This means that Part.CFrame + Part.CFrame.lookVector * speed
will move the part in its direction and since the lookVector is only 1 stud, to change the amount of studs passed every time it is ran, multiply it by speed. |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2016 02:17 AM |
And no, the correct way is Velocity = obj.CFrame.lookVector
not Velocity = Vector3(obj.CFrame.lookVector)
|
|
|
| Report Abuse |
|
|
|
| 27 Jul 2016 02:19 AM |
| So I am right. Your no help, I just figured it out using my method, I had a variable wrong thats why it didnt work. |
|
|
| Report Abuse |
|
|
sioux123
|
  |
| Joined: 18 Nov 2011 |
| Total Posts: 970 |
|
|
| 27 Jul 2016 04:01 AM |
Idk if this is relevant anymore But CFrame.lookVector returns a unit(1 magnitude vector going directly off the face of the part)
If you did part.Position + part.CFrame.lookVector you would get it to go in the direction of the face by 1 stud i'm pretty sure |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2016 04:02 AM |
No. You were wrong OP. "Vector3.new(Part.CFrame.lookVector)" ends you up with a Vector3 with all 3 components being 0. Get over yourself. |
|
|
| Report Abuse |
|
|
VoidFrost
|
  |
| Joined: 14 Oct 2011 |
| Total Posts: 1188 |
|
| |
|