Overlapping
hi, i am trying to overlap actor1 into actor2 and when actor1 is completely in the position of actor2 change the direction of actor1, i have been trying to use the magnitude attribute but when there is two actors2 in scene actor1 will only recognize the distance of the farthest one and it will only work with that actor2, so is there another method to overlap actors besides using the magnitude attribute?
Comments
I think what you are missing is a condition in actor1 that says if the actor collides with actor2 AND the magnitude is a certain amount (or the x and y values are the same) then [do certain rules/behaviors]. The key is to have a rule in actor2 that says If actor collides with actor1 then constrain game.actor2X to self.position.x and game.actor2Y to self.position.y. Remove any other rules that constrain game.actor2X and game.actor2Y (or whatever you called those attributes). That way, as each actor2 touches actor1, it will broadcast its position. The only time it may give you trouble is if more than one actor2 touches actor1 at the same time.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User