Tap to move (with gravity)?

NtGNtG Member Posts: 103
edited December 2011 in Working with GS (Mac)
How can i make it so if the player taps to the left of my actor they move left and same for if they tap to the right? Also, I want gravity to still be active (accelerate down behavior), i would be able to do this easily except move and interpolate seem to override gravity... any suggestions?

Comments

  • NtGNtG Member Posts: 103
    Anybody do this before? I'm trying to use acceleration in addition to turning the max speed on and off at the correct times but i cant get it working.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    edited December 2011
    instead of move change the motion linear velocity x and that will respond to gravity
    for example:
    When key right is down, change attribute self motion linear velocity x to 250
    then in the otherwise section have a change attribute behavior and change self motion linear velocity x to 0

    when key left is down, change attribute self motion linear velocity x to -250
    then in the otherwise section have a change attribute behavior and change self motion linear velocity x to 0

    cheers
  • NtGNtG Member Posts: 103
    edited December 2011
    Thanks!, but now my animations aren't working correctly :(
  • NtGNtG Member Posts: 103
    edit: nevermind.
Sign In or Register to comment.