how can i make a this rule plz read

pipepipe Member Posts: 54
how can I make a rule saying that which ever character is closer to this actor wins

Comments

  • VoidedSkyVoidedSky Member Posts: 1,095
    You will have to use the function magnitude. This function is used to determine the distance between an actor, and another actor.
  • pipepipe Member Posts: 54
    i dont have that do I have to update gamesalad
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    you have it, it's not a rule it's a function of the expression editor. in basic code, you'll need an attribute called distance on each character. constrain that attribute to a magnitude of the x value of the actor - x value of the character, y value of the actor - y value of the character.

    that will give each character the distance from the actor. then you'll have to come up with code to figure out which one is the shortest and then decide what you want to happen.
  • pipepipe Member Posts: 54
    edited June 2013
    magnitude available for windows?
Sign In or Register to comment.