playMaker

Author Topic: GUI Element Hit Test help [Solved]  (Read 3311 times)

tofusoup

  • Playmaker Newbie
  • *
  • Posts: 30
GUI Element Hit Test help [Solved]
« on: June 12, 2011, 09:09:49 PM »


Just testing out the new GUI element hit test.  Ran into an issue I'm not sure if it's my state machines or a bug.

Explanation:
If you touch the GuiTexture it will turn the cube green.  I'm printing the X position of my touch

Results:
Right now when I load up the app I can touch on screen and the cube stays red.
When I touch the GuiTexture the cube turns green
However from then on, every time I touch the cube turns green

So somewhere in my FSM it's triggering a hit after each touch.  Also I noticed that after clicking on the GuiTexture my variable "myX" stays the same value.
« Last Edit: June 13, 2011, 04:56:25 PM by tofusoup »

tofusoup

  • Playmaker Newbie
  • *
  • Posts: 30
Re: GUI Element Hit Test help
« Reply #1 on: June 13, 2011, 04:11:20 PM »
I ended up putting more debug text on screen, and it seems my FSM is ok, but the GuiElement hit test results do not get reset on each touch.

So after it detects a hit, every touch is a hit.  Unless I'm suppose to somehow reset this?  I have no clue.  Seems like a bug otherwise.  I'll wait for someone else to confirm this.  I'm not 100% sure of my state machines, or if I'm actually using hitTest correctly.

tofusoup

  • Playmaker Newbie
  • *
  • Posts: 30
Re: GUI Element Hit Test help [Solved]
« Reply #2 on: June 13, 2011, 04:57:56 PM »
After typing my own reply I figured it out.  I simply had to set my vector3 var back to (0,0,0).


Alex W.

  • Playmaker Newbie
  • *
  • Posts: 13
Re: GUI Element Hit Test help [Solved]
« Reply #3 on: August 25, 2011, 10:19:04 AM »
yes, set the vector to 0 on the first state. this works. very useful for me, thanks!