generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

how2math with bodyvelocity and bodyangularvelocity

Previous Thread :: Next Thread 
Myaxp is not online. 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 is not online. Myaxp
Joined: 05 Jul 2010
Total Posts: 248
29 Feb 2016 12:21 PM
bump

--// Myaxp

Report Abuse
Myaxp is not online. Myaxp
Joined: 05 Jul 2010
Total Posts: 248
29 Feb 2016 01:19 PM
bump

--// Myaxp

Report Abuse
HarrySnotte is not online. HarrySnotte
Joined: 27 Jun 2011
Total Posts: 2854
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image