playMaker

Author Topic: Touch screen + moving left/ right  (Read 1078 times)

ItzArranT

  • Playmaker Newbie
  • *
  • Posts: 45
Touch screen + moving left/ right
« on: January 30, 2018, 08:29:40 AM »
Hey all,

I want to create a control setup wherein the screen (landscape) is "cut in half"- tapping on the left portion of the screen moves the character left and tapping on the right portion of the screen moves the character right.

I have got the "cut in half" part sorted, but I don't how to make the character move in the corresponding direction, any ideas? I'd like it if the character keeps moving in the corresponding direction so long as I keep my finger on the screen.

UPDATE: I've got this working using a Character Controller component but would prefer a solution involving a Rigid Body.
« Last Edit: January 31, 2018, 03:48:40 AM by ItzArranT »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Touch screen + moving left/ right
« Reply #1 on: January 31, 2018, 03:54:02 AM »
Hi,

 you'll need to use either complex vector math, or some custom actions doing this for you, like ScreenTo3dPlane action, wich lets you know the position in the 3d world on a specific plane ( ground likely), then you can control your rigidbody to move towards that point on the ground.

 Bye,

 Jean