Return to position
nbaier
Member Posts: 1
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
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.
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