Drag & Drop Constrain
Hi folks,
I have been making an actor drag n drop, then when it collides with another object, it constrains attribute so it sticks to that other object, and then you can pull it off and replace to original position. The problem with this technique is that they seem to pull together even when 1/2 and inch apart. How do I make them stick to only a small area within the other object?
I have been making an actor drag n drop, then when it collides with another object, it constrains attribute so it sticks to that other object, and then you can pull it off and replace to original position. The problem with this technique is that they seem to pull together even when 1/2 and inch apart. How do I make them stick to only a small area within the other object?
Comments
The Game Attributes are real - posX and posY
Actor "ball" has code:
Constrain Attribute: game.posX To: self.Position.X
Constrain Attribute: game.posY To: self.Position.Y
Code inside draggable "bat"
When the Actor receives event-overlaps or collides-with actor of type-"ball"
Constrain Attribute: self.Position.X To: game.posX
Constrain Attribute: self.Position.Y To: game.posY
Here you go:
http://instantmashgames.com/files/Shapes.gameproj.zip
This should help you
Ace