Data Realms Fan Forums
http://45.55.195.193/

Calculating velocity.
http://45.55.195.193/viewtopic.php?f=73&t=21528
Page 1 of 1

Author:  Kettenkrad [ Fri Feb 18, 2011 7:12 am ]
Post subject:  Calculating velocity.

Ok ok, know I suck at .lua when I can't figure out something's speed. Here's the rundown:


I've got an MOPixel, a LAZARBEEM pixel, and when it hit's something it rebounds stupidly and looses all it's speed and looks stupid. So I want to attach a script that makes it delete itself if it's velocity is less than 80. Problem is; velocity in .lua seems to be X and Y, so I was all like
Code:
"O yeah that'll be simple; If Vel X or Vel Y < 80 delete hurr durr"

But I can't shoot backwards, down or up cause of negatives and such. So I ask if anyone will provide me with a formula to make an MOPixel delete itself if it's velocity is less than 80.
Thankyous in advance: Thankyous.

Author:  411570N3 [ Fri Feb 18, 2011 8:19 am ]
Post subject:  Re: Calculating velocity.

Self.Velocity.Magnitude is what you'll be wanting to measure.

Author:  Kettenkrad [ Fri Feb 18, 2011 10:38 am ]
Post subject:  Re: Calculating velocity.

Thanks, Allstone, much appreciated.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/