playMaker

Author Topic: throwing a ball (object) with swipe gesture  (Read 10252 times)

merde10

  • Playmaker Newbie
  • *
  • Posts: 46
  • new user of playmaker :)
Re: throwing a ball (object)
« Reply #15 on: June 03, 2016, 08:58:51 AM »
i know what you mean and i understand.

i just found a solution. But i have two more issues. So when i swipe on my screen, the ball follows the direction of my swipe like i wanted.

but:

- when i tap my screen, it adds force along the y axis, and it's very easy to score. So i add a "swipe gesture event" state, before "touch event" and "get touch info" state, so
 the player must have to swipe to shoot, but by doing this, i need to swipe 2 times to shoot.
I also put the "swipe gesture event" into the same state, but when i tap it shoots lol.

- the detection of the shoot along x axis is weird. For example, when i swipe to the right, the shoot follows the swipe gesture. But when i swipe to the other side (left), it shoots up.

(i test that with unity remote).




PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: throwing a ball (object)
« Reply #16 on: June 03, 2016, 09:08:27 AM »
I can't help with the swipe gestures, as I have no experience with them.
About the strange behaviour shooting right ok, but shooting up when swiping left, check the axis of the ball when it spawns, or whatever method you are using to spawn the ball and also the direction of the force applied. It's very probably something to do with inconsistence in these things.

merde10

  • Playmaker Newbie
  • *
  • Posts: 46
  • new user of playmaker :)
Re: throwing a ball (object)
« Reply #17 on: June 07, 2016, 07:38:23 AM »
I think it's about when it store the x value, because when i see the x value when i "swipe" it's completely weird.

Also i build the game to see on my device how it looks, and the x axis doesn't to work, it only shoots on the y axis.

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: throwing a ball (object) with swipe gesture
« Reply #18 on: June 07, 2016, 08:23:28 AM »
I imagine you are swiping from the bottom of the screen up.
This is why Y is growing but X is probably just oscillating on low values.
You should understand how X changes when you swipe, to correct the problem, there's no shorter way.

merde10

  • Playmaker Newbie
  • *
  • Posts: 46
  • new user of playmaker :)
Re: throwing a ball (object) with swipe gesture
« Reply #19 on: June 07, 2016, 08:42:18 AM »
yes, this is why i add a multiply state to increase the x value, it works on the remote app, but not on my device when i build the game.

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: throwing a ball (object) with swipe gesture
« Reply #20 on: June 07, 2016, 09:18:52 AM »
Deh this is that kind of problem that can drive you crazy... different behaviour based on the devices... good luck with that, I can't help here  :D