move actor by a certain amount

sl-imagessl-images Member Posts: 44
edited November -1 in Working with GS (Mac)
is it possable to move an actor by say 90px when told to ie. press right actor moves right 90px press up actor moves up 90px?

Comments

  • sl-imagessl-images Member Posts: 44
    is it possable to move an actor by say 90px when told to ie. press right actor moves right 90px press up actor moves up 90px?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    yes you can use interpolate. For right you would interpolate self position x to self position x+90
    for left interpolate self position x to self position x-90
    for up interpolate self position y to self position y+90
    and for down interpolate self position y to self position y-90

    cheers
  • sl-imagessl-images Member Posts: 44
    thanks !
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Don't use interpolate of an attribute to itself plus/minus a number. Since Interpolate is constantly updating values, first save the target destination (self.attribute-90) into an attribute then interpolate the attribute to that target value.
Sign In or Register to comment.