playMaker

Author Topic: [SOLVED] Trying to understand MousePick & Touch on iOS  (Read 3329 times)

dogbreath

  • Playmaker Newbie
  • *
  • Posts: 9
[SOLVED] Trying to understand MousePick & Touch on iOS
« on: April 26, 2012, 07:30:38 PM »
I'm a little confused I'm using an fsm on a GameObject in order to send an event if that object gets selected.  

Mouse Down or Touch will trigger the selected.

The first state just stores the owner of the fsm in a gameObject variable.

The second state waits for a mouse down.

The third state uses a mousePick and stores the object selected in a separate variable and then compares the two variables. If they are equal it goes to the 4th state.  If not, it goes back to the 2nd state and waits for another input.

In the 4th state I send a message to my external script which does some fun stuff.

The PROBLEM I am having is that the mousePick doesn't seem to work.  I'm never able to get the compare to work.  There is a collider on my gameObject, but I swear I can't get this seemingly simple behavior to work.  I just want to send a message from a selected game object.


Any help would be great.  I'm baffled by this.

thanks,

here pictures of the states of the fsm


« Last Edit: April 30, 2012, 12:10:37 PM by dogbreath »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Trying to understand MousePick
« Reply #1 on: April 26, 2012, 07:37:57 PM »
Quote
The second state waits for a mouse down.

Do you mean the MOUSE DOWN system event? That is sent when the user clicks on a game object. So the other steps are not really required - you already know the user has clicked on the object.

Unless I misunderstand...?

dogbreath

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Trying to understand MousePick
« Reply #2 on: April 26, 2012, 07:46:41 PM »
The mouse down seems to fire everytime I click the mouse.  Not just when I click the object which is attached.

Unless I'm confused?

Here's the action I'm using...
« Last Edit: April 26, 2012, 07:50:10 PM by dogbreath »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Trying to understand MousePick
« Reply #3 on: April 26, 2012, 07:53:34 PM »
I think you're going about things the hard way!

If your object has a collider, you can just use the MOUSE DOWN system event.

dogbreath

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Trying to understand MousePick
« Reply #4 on: April 26, 2012, 07:56:35 PM »
"HAHA HAHA"

delirious laughing....


thanks for the help!  I'm still figuring this Playmaker tool out!


Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Trying to understand MousePick
« Reply #5 on: April 26, 2012, 08:03:29 PM »
No problem! Making the more complex FSM is still good practice ;)

dogbreath

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Trying to understand MousePick
« Reply #6 on: April 27, 2012, 10:53:18 AM »
I'm using Touch Object and Touch Object Event and I'm not able to get them to fire when I test on an iphone.

Is there a different action I should be using?

I just want to simply send a message when I register a device touch.


thanks,