Return to position

nbaiernbaier Member Posts: 1
edited November -1 in Working with GS (Mac)
how do I make my actor only move down 100 pixels when pressing a key and when the key is release the actor returns to position like its attached to a rubber band, smoothly.

Comments

  • DookiDooki Member Posts: 247
    Well I'm new to this but I at least can help you halfway.

    Create a rule with an added attribute.

    Rule= when KEY is DOWN (and you will select the down arrow button on the virtual keyboard)
    --MOVE TO= enter "-100" in the vertical movement box. (Make sure you have "Relative to actor" checked)

    Now place you actor where you want, and when you press the down arrow on your keyboard it should move 100 pix down. As for moving back up when you release the key, I don't know. Sorry.
  • MagoNicolasMagoNicolas Member, PRO Posts: 2,090
    Create 1 Attributes
    Inital Y.
    Make a Change Attribute: Initial Y To self.position.y

    When Key Press:

    Change Attribute, Self.Motion.LinearY To -Speed (Your speed)
    Otherwise, Move To Seld.Position X (In X)
    And Inital Y (In Y)

    Charan!
    Done
Sign In or Register to comment.