playMaker

Author Topic: Touch object event problem  (Read 2340 times)

bizilux

  • Full Member
  • ***
  • Posts: 171
Touch object event problem
« on: January 27, 2014, 08:11:52 AM »
hey all...

so im making racing game... and i need help with car movement buttons...
(attachment 1)

they are sprites with 3d box collider, parented to main camera. they work perfectly... there is only one problem

if i put my finger on gas, and then release my finger while its still withing collider of gas, then it detects that finger was released.

but if i put my finger on gas, and drag my finger off the gas button, it doesnt detect that finger was dragged off the gas collider, so if i release my finger somewhere not on gas sprite, then it wont detect that finger was lifted, so it will just keep the throttle at full.

so basically it works perfectly if player keeps his finger on throttle, but as long as he drags finger off throttle sprite, it breaks functionality...

so what am i missing?



i found this however: http://hutonggames.com/playmakerforum/index.php?topic=1997.0   anything in there that will fix my problem?
« Last Edit: January 27, 2014, 08:18:26 AM by bizilux »

bizilux

  • Full Member
  • ***
  • Posts: 171
Re: Touch object event problem
« Reply #1 on: January 28, 2014, 07:15:55 AM »
anyone? :)

basically all i would need is:  "moved off" event

TIGGYsmalls

  • Junior Playmaker
  • **
  • Posts: 80
Re: Touch object event problem
« Reply #2 on: January 28, 2014, 08:59:58 AM »
On state 2 have touched moved looped back to state 1.

So if your finger dose move then you check if it over the button.

I think that should work.

bizilux

  • Full Member
  • ***
  • Posts: 171
Re: Touch object event problem
« Reply #3 on: January 28, 2014, 10:28:37 AM »
good try, but it doesnt work... because as soon as it detects "touch moved" it goes to state 1,  but then you still have ur finger on screen, so state 1, wont trigger off "touch began" because you didnt lift finger and pressed it again.

i think it has to be done some other way...

it basically wont trigger state 1 again, because you didnt lift ur finger... so touch object event action, will not trigger

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Touch object event problem
« Reply #4 on: January 30, 2014, 06:01:03 AM »
Hi,

 You should use ngui and then you could have all these events ready made for you.

https://hutonggames.fogbugz.com/?W1111

bye,

 Jean