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 » Scripting Helpers
Home Search
 

Re: How do I get velocity?

Previous Thread :: Next Thread 
TheProgrammingMaster is not online. TheProgrammingMaster
Joined: 20 Aug 2011
Total Posts: 7602
28 May 2014 07:16 PM
I know there's a x,y,z value in the properties, But how would I get how fast it's going total?
Report Abuse
TheProgrammingMaster is not online. TheProgrammingMaster
Joined: 20 Aug 2011
Total Posts: 7602
28 May 2014 07:18 PM
x+y+z?
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
28 May 2014 07:18 PM
math.sqrt((Part.Velocity.X)^2 + (Part.Velocity.Y)^2 + (Part.Velocity.Z)^2)
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
28 May 2014 07:21 PM
Or you could just do Part.Velocity.Magnitude.
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
28 May 2014 07:22 PM
are you serious
Report Abuse
TheProgrammingMaster is not online. TheProgrammingMaster
Joined: 20 Aug 2011
Total Posts: 7602
28 May 2014 07:22 PM
What is Magnitude?
Report Abuse
TheProgrammingMaster is not online. TheProgrammingMaster
Joined: 20 Aug 2011
Total Posts: 7602
28 May 2014 07:23 PM
I know it's how do use I for distance, but I don't know what it is exactly.
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
28 May 2014 07:25 PM
Magnitude is the distance of a vector merged into 1 number. More here:
http://wiki.roblox.com/index.php?title=Magnitude

Report Abuse
TheProgrammingMaster is not online. TheProgrammingMaster
Joined: 20 Aug 2011
Total Posts: 7602
28 May 2014 07:30 PM
So like this?

local screen=script.Parent
local part=screen.Parent
part.Changed:connect(function(property)
local velocity=part.Velocity
local position=part.Position
screen.Velocity.Text='Velocity|'..veloctiy.Magnitude
end)
Report Abuse
wohoo1997 is not online. wohoo1997
Joined: 28 Jan 2011
Total Posts: 9101
28 May 2014 07:31 PM
Have you learned this in Science Class yet?
Velocity is Speed + Direction.
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
28 May 2014 07:43 PM
@woohoo
get out
@theprogramming
Yes, except that you spelled velocity wrong on the line where you set the text.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
28 May 2014 07:44 PM
Magnitude is literally doing exactly what Josh said.
But all Vector3's have a built-in member than does it for you.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
28 May 2014 07:44 PM
local screen=script.Parent
local part=screen.Parent
part.Changed:connect(function(property)
local velocity=part.Velocity
local position=part.Position
screen.Velocity.Text='Velocity|'.. tostring(velocity.Magnitude)
end)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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