Constrain Mouse Position

UnicornInvasionUnicornInvasion Member Posts: 301
edited February 2012 in Working with GS (Mac)
I have constrained the mouse position to

When Mouse Position is inside Constrain mouse position.

However I want it to be when you click it it does not constrain to mouse position. But I also want it to be from that moment on I do not want to it to be able to constrain the mouse position.

Comments

  • POMPOM Member Posts: 2,599
    Hey ,
    Make a self attribute - boolean - and call it "dragged"
    New a rule :
    when touch is pressed
    Change self.dragged TO true
    OTHERWISE
    Change self.dragged TO false

    Now a new rule :
    When self.dragged IS true
    Constrain self.position.X TO touch X
    Constrain self.position.X TO touch Y

    Hope that will help you.
    Roy.
  • UnicornInvasionUnicornInvasion Member Posts: 301
    Thank You so much Roy! That was a big help.
Sign In or Register to comment.