How To Swipe Upward to make a actor go up and at angle of swipe

hzappshzapps Member, PRO Posts: 173
Aloha all,

I am having trouble with a SWIPE concept to use on a Portrait mode screen
I want to essentially swipe my finger up and the dude on a skateboard goes up and at what ever angle I swiped at directionally.
The best I could compare to would be like using the cannon template.
The Skater would be at rest and you would swipe upward over him and he would take off up at any angle of the swipe.

The speed does not have to be controlled by the swipe just which direction it goes.

Thanks for all of your help
Hang Loose
Mike

Comments

  • LumpAppsLumpApps Member Posts: 2,881
    Make three attributes in the skater. initx and inity. And one named direction.
    Then a rule: on mouse button down
    Change initx to mouseposition.x
    Change inity to mouseposition.y

    Then a new rule: on mouse button up
    Accelerate to vectortoangle(mouseposition.x-initx,mouseposition.y-inity)
    Speed "whatever"

    If you also want the speed dependent on the distance swiped you can put this in the speed:
    Magnitude(mouseposition.x-initx,mouseposition.y-inity)

    I am doing this without my Mac nearby so I might have made some minor mistakes.

    Good luck!
    Ludwig
  • hzappshzapps Member, PRO Posts: 173
    Thank You Ludwig. Awesome. I also have enjoyed some of your tutorials. It is greatly appreciated.

    Hang Loose
    Mike
Sign In or Register to comment.