Sticking Actors - Need help fast

Hi there, could anyone please explain me how i stick actors to each other when they overlaps or collide??
Please someone explain me fast :P
Cheers
Please someone explain me fast :P

Cheers
Comments
Rule: when
Actor receives event: overlaps or collides with actor2
--Interpolate or changeAttribute
----self.Position.X To: scene.layer.actor2.Position.X
----self.Position.Y To: scene.layer.actor2.Position.Y
have both actors on same layer … of course the actor on top is higher in the layer (you can R click the actor in scene and change its order in that layer)
@};- MH
Actor1X
Actor1Y
In Actor1
Constrain attribute game.Actor1X to self.positionX
Constrain attribute game.Actor1Y to self.positionY
In Actor2
Rule
WhenActor2 overlaps or collides with Actor1
Constrain attribute self.positionX to game.Actor1X
Constrain attribute self.positionY to game.Actor1Y
Be careful using too many constrains though as they'll start to hurt game performance.
Hope that helps.
Cheers
cheers