![]() |
Falling speed? - Printable Version +- 2DWorlds Forums (http://2dworlds.buildism.net/forum) +-- Forum: 2DWorlds (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=4) +--- Forum: Suggestions (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=19) +--- Thread: Falling speed? (/showthread.php?tid=5889) |
Falling speed? - Blandflakes - 06-17-2011 I'm not sure if this can already be done but it would help if there was a way to tell how fast a box or circle is falling. RE: Falling speed? - Qwertygiy - 06-17-2011 [lua] falling = false while true do sleep(0.01) if Part.Velocity.y < 0 then falling = true else falling = false end end [/lua] Or something like that. ![]() RE: Falling speed? - AK-47 - 06-18-2011 [lua] local c = create("Label") c.Parent = script.Parent function round(num, idp) local mult = 10^(idp or 0) return math.floor(num * mult + 0.5) / mult end while true do local FallSpeed = round(script.Parent.Velocity.y) c.Text = "Fall Speed:"..FallSpeed * -1 sleep() end [/lua] Honestly, I copied off the rounding function somewhere. If the value wasn't rounded, the value would be pretty large. *Large as in many decimal places. PS: Just insert this in any part. Also, if you just want the fall speed of an object when the game is paused, all you need to do is click the object, look at its properties, check under velocity, and check its second value. |