playMaker

Author Topic: [SOLVED] Touch Object Event problems  (Read 4400 times)

dogbreath

  • Playmaker Newbie
  • *
  • Posts: 9
    • View Profile
[SOLVED] Touch Object Event problems
« on: April 27, 2012, 10:32:59 AM »
Hello,

I'm mystified by what should be a very simple action.

I want to send a custom event when my GameObject/Sprite is touched.  

When I use the Touch Object event action, I can't seem to get a touch on the actual device(iphone4).

I've checked the colliders and tested via the Game Screen and everything works fine, but on the device, it's not working.

Any ideas as to what I'm doing wrong?

here's a screen shot of the simple fsm.

As I've been waiting for a response, I've tried putting a fingerGesture tap component on this object with no luck and I also tried using a fsm "Touch to Mouse Converter" which was referenced in an earlier post.

When I use the action "TouchEvent".  It fires every single time, whenever and wherever I generate I touch.   However, I'd like to confine the event to send only when I select an object.


I'm baffled.  Please help:)
« Last Edit: April 30, 2012, 09:09:54 AM by dogbreath »

shinodan

  • Full Member
  • ***
  • Posts: 171
    • View Profile
    • Shinozone
Re: Touch Object Event problems
« Reply #1 on: April 27, 2012, 11:06:21 PM »
Have you tried unity remote? i dont know if it is on ios, but you could test and see what your state machine is upto while testing. i dont really know as ur setup looks fine but i cant see whats in the finished state. what type of object are you wanting to touch? does it have a collider?
« Last Edit: April 27, 2012, 11:27:11 PM by shinodan »

dogbreath

  • Playmaker Newbie
  • *
  • Posts: 9
    • View Profile
Re: Touch Object Event problems
« Reply #2 on: April 28, 2012, 06:36:52 AM »
I'm using a packedSprite component sitting on a game object which also has a collider on it. 

I've also tried using an ezgui button. 

The ezgui button will fire and the MethodToInvoke will work but I want to pass a parameter along with the method so I can't use the MethodToInvoke call. 

I'm confused, it's almost as if the TouchObjectEvent is getting swallowed by something in the event chain?  But I'm not completely clear on how everything works in the event loop.

Any ideas?

thanks!

I'll try unity remote.

dogbreath

  • Playmaker Newbie
  • *
  • Posts: 9
    • View Profile
Re: Touch Object Event problems
« Reply #3 on: April 28, 2012, 08:14:58 AM »
I've tried using unity remote.  The touch event is handled as a mouse down and everything works fine. 

However, when I install the build on the device and test, the touch doesn't register and I'm back to my original problem.

Unity remote doesn't seem to accurately represent the event flow.

Ideally, I would see unity remote fire the "touch event flow" and instead I'm seeing it fire the "mouse down" event flow.  And when I use it as an actual app.  This touch doesn't register either way.  VERY CURIOUS>>>


any ideas now?


justifun

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 228
    • View Profile
Re: Touch Object Event problems
« Reply #4 on: April 28, 2012, 10:52:59 PM »
Here's 2 things to try.  Put the Touch object event as the very first action in your list just to make sure nothing else is conflicting with it.

Also, up the "pick distance" to something really high (say 10000) to make sure that its simply not the case that your button is too far away.

Are you using an actual object for a button i assume? like a plane with the texture on it?

If so, then touch object event should work fine.

Not sure how that action works with a gui texture/element.

So try making a fake button out of a cube with a texture on it, and see how it works for ya.

dogbreath

  • Playmaker Newbie
  • *
  • Posts: 9
    • View Profile
Re: Touch Object Event problems
« Reply #5 on: April 30, 2012, 09:09:33 AM »
I reimported my playmaker files with the new version 1.3.2 and now everything is working as it should in my simple test project.  I'm still having issues with my project that has ezgui controls and playmaker, but I'm sure I'll sort it out here soon enough.

thanks,