Magnitude

Magnitude is one of the few things I actually don't know how to use, say I've got an actor (magnet or something) and another actor (I don't know paper clip
) How do you use magnitude to pull the paperclip towards the magnet?? thx

Comments
Now in your magnet actor add at the top
Constrain game.Magnet.X to self.position.x
Constrain game.Magnet.Y to self.postion.y
Now in your paper clip
Constrain self.distance2magnet to magnetude(self.position.x-game.Magnet.X,self.position.y-game.Magnet.Y)
When self.distance2magent is < 100
--Accelerate Direction vectortoangleself.position.x-game.Magnet.X,self.position.y-game.Magnet.Y)
Speed - ((self.distance@magnet/100)x5000)
Try that out and see how that works for you. I have not tried this at all. But the logic makes sense. It should even be setup with the accelerate to start out slow and then get faster as it gets closer to the magnet.
Good Luck Hope it helps
Aaron
Edit: Apparently TSB types faster than me. Looks to be close to the same. I did leave out the real type attributes. Mine will work better if your magnet is moving.
___________________________________________________________________________________
TEMPLATES AND PROJECT HELP BY TENRDRMER. CLICK HERE!!!
AppSolute Entertainment on Facebook
AppSolute Entertainment on iTunes