Overlap

disparitiondisparition Member Posts: 32
edited March 2012 in Working with GS (Mac)
hi, i am trying to make an actor overlap another one and when that happens actor 1 changes direction, but i am trying to do it without the magnitude attribute, so i would like to know if there is another method to make an actor overlaps completely another one ?

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Magnitude is certainly the most precise method. Why don't you want to use it? Another method I can think of is to check both actors' x and y positions for matches. Just constrain game.Actor2X and game.Actor2Y to (Actor2).position.X and (Actor2).position.Y and then in Actor1's rules have a rule that says if ALL conditions are true and game.Actor2X=self.position.X and game.Actor2Y=self.position.Y then .

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • disparitiondisparition Member Posts: 32
    i am trying to use the method that you are suggesting but it doesnt seems to work, the reason why i dont want to use magnitude even though i agree with you is more precise is because sometimes i have 2 actors2 in scene so actor 1 only recognizes the distance of the actor2 that is in the farthest place so when it overlaps the actor2 that is nearest it doesnt react to it because it is recognizing the magnitude of the other one, so im trying to look for a code that even if they are 2 actors2 in scene actor1 can work with both actors and not only the one that is farthest, if you have a better idea of my problem i would appreciate if you can help me if you can, if not well you tried and i am thankful for that. thank you
Sign In or Register to comment.