I would do something like that: You have your Hero actor, and magnet actor. Make also a second magnet actor, resize it to be bigger than the original actor, and make it invisible. Constrain position of one magnet actor to the second, and in the invisible actor put a rule that when Hero player collides with that actor, some game attribute changes to True. In your main magnet actor put a rule that, when this game attribute is True, he will move to your Hero actor (use constrain behavior).
after you do that youll need to make 2 real attributes ill call them magnetx and magnety
in the magnet actor constrain magnetx to self postionx and constrain magnety to self position y
then in whatever actor you have the magnitued set up so itll be affected by the magnet, where you have your rule when magnitude attribute you make is > or < whatever you want
have a accelerate toward behavior in that rule and for the x positition in that behavior select the attribute magnetx and for the yposition select magney
I would have done it word for word the way TheMoonWalls said. JohnPapiomitis's idea of magnitude sounds awesome, defiantly a video to check out myself, i wonder which method is best for performance?
Comments
Hope that you understand what I said
http://www.youtube.com/user/GameSaladCookbook/#p/search/0/_p2s61XVZ0o
after you do that youll need to make 2 real attributes ill call them magnetx and magnety
in the magnet actor constrain magnetx to self postionx and constrain magnety to self position y
then in whatever actor you have the magnitued set up so itll be affected by the magnet, where you have your rule when magnitude attribute you make is > or < whatever you want
have a accelerate toward behavior in that rule and for the x positition in that behavior select the attribute magnetx and for the yposition select magney
I would use John's way. He is more experienced in this type of games, than me.
Ace