playMaker

Author Topic: Continuous touch detection  (Read 875 times)

eyeofhorus

  • Playmaker Newbie
  • *
  • Posts: 1
Continuous touch detection
« on: June 13, 2017, 08:44:43 AM »
Hello,

I'm trying PlayMaker on a 2D platformer game.

I'm trying to implement a touch control so that when I touch the right side of the character, he will move to the right, and vice versa. And it should continuously detect the position of the touch to switch direction.

The idea is to get the touch's screen to world position and compare with the player's position, then trigger a state to set the x-axis velocity.

However I'm struggling to continuously detect the position of the touch smoothly. In the state that I move the player, I listen to the "touch-stationary" phase and continuously transit it to a compare position state where it determines if the player should go left or right.

But there is a delay before the Touch Ended event as the states of moving and comparing keeps looping between. I'm not sure if it's the proper way to implement this. What is a good way to implement such scenario?

I came from the coding side, with coding this should to be trivial to do.

PlayMaker is great for laying out cut scenes and animation, and I would like to explore about the workflow. So secondly, if your are a coder, how would you use PlayMaker in your project?

Cheers,