Myaxp
|
  |
| Joined: 05 Jul 2010 |
| Total Posts: 248 |
|
|
| 29 Feb 2016 12:06 PM |
read de title k
how2math kthx
(Ok seriously)
If I were to make a spaceship that moves from point A to point B how would you do that with BodyAngularVelocity and BodyVelocity. No offence but the wiki is not very helpful in that and neither is youtube.
I suppose it would be some kind of math to calculate the position of part1 and part2.
--// Myaxp
|
|
|
| Report Abuse |
|
Myaxp
|
  |
| Joined: 05 Jul 2010 |
| Total Posts: 248 |
|
| |
Myaxp
|
  |
| Joined: 05 Jul 2010 |
| Total Posts: 248 |
|
| |
|
| 29 Feb 2016 01:41 PM |
If I were you I'd use BodyGyro instead of BodyAngularVelocity if you want to make it to fly from a known point A to a known point B. If you were to use BodyGyro, you just need to give it the position of point B and it'll automatically face that way. BodyVelocity isn't that hard either, you just need to get the distance in Vector3 format between point A and point B, normalize it(that means that the magnitude of the Vector3 is 1, easy exemples are Vector3.new(0, 0, 1) or Vector3.new(1, 0, 0) or Vector3.new(0, 1, 0)) and multiply it by the speed you want the ship to go.
A complete exemple: local PointA = Vector3.new(0, 0, 0) local PointB = Vector3.new(10, 56, 165) local speed = 100
BodyGyro.CFrame = CFrame.new(PointA, PointB) BodyVelocity.Velocity = (PointB-PointA).Unit*speed BodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge) |
|
|
| Report Abuse |
|
Myaxp
|
  |
| Joined: 05 Jul 2010 |
| Total Posts: 248 |
|
|
| 29 Feb 2016 02:26 PM |
oh right...
I see how it works. Ok thanks!
--// Myaxp
|
|
|
| Report Abuse |
|