View unanswered posts | View active topics It is currently Thu Dec 26, 2024 5:55 pm



Reply to topic  [ 3 posts ] 
 Calculating velocity. 
Author Message
User avatar

Joined: Mon Oct 25, 2010 5:51 am
Posts: 1198
Location: Sydney
Reply with quote
Post 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.


Fri Feb 18, 2011 7:12 am
Profile
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post Re: Calculating velocity.
Self.Velocity.Magnitude is what you'll be wanting to measure.


Fri Feb 18, 2011 8:19 am
Profile WWW
User avatar

Joined: Mon Oct 25, 2010 5:51 am
Posts: 1198
Location: Sydney
Reply with quote
Post Re: Calculating velocity.
Thanks, Allstone, much appreciated.


Fri Feb 18, 2011 10:38 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.420s | 13 Queries | GZIP : Off ]