playMaker

Author Topic: Unity Buttons Staying Highlighted [SOLVED]  (Read 13207 times)

mTruly

  • Junior Playmaker
  • **
  • Posts: 98
    • View Profile
Unity Buttons Staying Highlighted [SOLVED]
« on: February 26, 2016, 10:20:28 AM »
Not sure if this is a Playmaker issue but Playmaker is involved.

I have a setup where Playmaker sends events based on the pressing of Unity UI buttons.  All works fine with this but there is an issue where when the user clicks on the Unity UI button, the event is sent properly but the button remains in it's highlighted condition.  (see attached image).

Is there some way of forcing the button to return to it's normal condition?
« Last Edit: March 04, 2016, 12:30:28 PM by mTruly »

mTruly

  • Junior Playmaker
  • **
  • Posts: 98
    • View Profile
Re: Unity Buttons Staying Highlighted
« Reply #1 on: February 28, 2016, 07:32:04 AM »
There's got to be some way of making Unity buttons return to their Normal condition.

I found that there is a Canvas Force Update action and tried adding this but it made no difference... Unity buttons are staying highlighted.

Any ideas?

Thanks!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4968
    • View Profile
    • jinxtergames
Re: Unity Buttons Staying Highlighted
« Reply #2 on: February 28, 2016, 08:54:18 AM »
Hi,
Are you using the "PlayMakerUGuiComponentProxy" Component?

Can you give some more information how you have setup you states with pictures if possible?

mTruly

  • Junior Playmaker
  • **
  • Posts: 98
    • View Profile
Re: Unity Buttons Staying Highlighted
« Reply #3 on: February 28, 2016, 09:10:40 AM »
Thanks for the ideas!

I'm not using that component... I'll have to look into what it is.

The states are really simple and I'm using the U Gui Button On Click Event to send events from Unity buttons.  (See attached screengrab).

Thanks again.

Zeldag

  • Full Member
  • ***
  • Posts: 198
    • View Profile
Re: Unity Buttons Staying Highlighted
« Reply #4 on: February 28, 2016, 10:09:05 AM »
I think that is a componenet that comes with the UGUI actions. Ive heard that you need to have it in the scene (or on the gui objects i cant rememeber). But to be honest all my uGUI actions always worked without it, not sure why...

mTruly

  • Junior Playmaker
  • **
  • Posts: 98
    • View Profile
Re: Unity Buttons Staying Highlighted
« Reply #5 on: February 29, 2016, 07:49:01 AM »
Thanks for the ideas!

I tried adding that action to the states that contain the Button Send Event actions and also tried adding them directly to the Unity button objects themselves and all this made no difference... the buttons function fine but the highlighted condition remains after the buttons are clicked.  If I click on empty space somewhere, the highlighted button returns to it's normal condition.

Thanks again.

mTruly

  • Junior Playmaker
  • **
  • Posts: 98
    • View Profile
Re: Unity Buttons Staying Highlighted
« Reply #6 on: February 29, 2016, 08:09:23 AM »
Another weird thing about this.

As in the image above, when the user clicks on the View A button, the proper event is sent but the button remains in its highlighted condition (instead of returning to the normal condition).

If the user uses any of the keyboard shortcuts for other (unrelated) functions... the highlighted UI button which was pressed earlier will change between highlighted and pressed and will return to the highlighted condition each time any keyboard shortcut is pressed.

Only if the user clicks the mouse somewhere else on screen will the highlighted button change back to normal.

mTruly

  • Junior Playmaker
  • **
  • Posts: 98
    • View Profile
Re: Unity Buttons Staying Highlighted
« Reply #7 on: March 01, 2016, 09:54:15 AM »
Is there some way to trick the system to work properly?

For example, If I click anywhere on screen after using the Unity button... the button returns to it's normal color (as it should be doing).

Is there a way to send an empty click after each button press so the button is tricked into refreshing properly?

Thanks!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4968
    • View Profile
    • jinxtergames
Re: Unity Buttons Staying Highlighted
« Reply #8 on: March 01, 2016, 10:28:01 AM »
Hi,
You should get the ugui proxy full package on the EcoSystem and check this tutorial out :


mTruly

  • Junior Playmaker
  • **
  • Posts: 98
    • View Profile
Re: Unity Buttons Staying Highlighted
« Reply #9 on: March 01, 2016, 11:33:23 AM »
Thanks very much for the info!

Unfortunately, that made no difference.

My button functionality is working fine currently... the only issue is that when the Unity button is clicked, it stays stuck on the highlighted color until the user clicks somewhere else... then the button color returns to the normal button color.

I recreated the tutorial steps precisely and get the exact same result... the clicked Unity button stays stuck on the highlighted color until the user clicks somewhere else... then the button returns to the normal color.

Latest Unity/latest Playmaker.

Thanks again.

« Last Edit: March 01, 2016, 11:37:37 AM by mTruly »

mTruly

  • Junior Playmaker
  • **
  • Posts: 98
    • View Profile
Re: Unity Buttons Staying Highlighted
« Reply #10 on: March 02, 2016, 08:00:15 AM »
I tested this problem on a second computer and got the same result... Unity buttons are staying highlighted after having been clicked.

playsteven

  • Junior Playmaker
  • **
  • Posts: 75
    • View Profile
Re: Unity Buttons Staying Highlighted
« Reply #11 on: March 02, 2016, 11:38:17 AM »
Hey mTruly,

I make extensive use of uGui and especially buttons in my game and I've never ran in to any of the issues you describe.

Is it possible you could dropbox/google drive/anything else a very basic Unity project with the error present and I'll check on my system?

Steven

mTruly

  • Junior Playmaker
  • **
  • Posts: 98
    • View Profile
Re: Unity Buttons Staying Highlighted
« Reply #12 on: March 02, 2016, 03:15:46 PM »
Sure I can share an example file... but I haven't really shared Unity/Playmaker projects yet so I'm not sure what the best way to share the example is?  Should I just post the Unity Scene or do I need to export a package?

Thanks!

playsteven

  • Junior Playmaker
  • **
  • Posts: 75
    • View Profile
Re: Unity Buttons Staying Highlighted
« Reply #13 on: March 02, 2016, 04:31:34 PM »
I was going to say upload the directory and PM me the link, but I realised it will contain the Playmaker directory and, although I obviously have a license, we would need permission from Alex or another member of the team.

[If Alex is reading and there is no issue, could you please say this is okay :) I totally understand if it is not.]

Otherwise, we'll just reproduce the steps :) Just number them and I'll follow them and we'll see if we get the same result. Just like ...

1) Create a new project
2) Import Playmaker
...

Bear in mind I'm not an expert like the other folks around here, but my game Mister Smith & His Adventures is nothing but buttons and there has never been an issue.

Might take a day or three of four to get back to you :)

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4968
    • View Profile
    • jinxtergames
Re: Unity Buttons Staying Highlighted
« Reply #14 on: March 02, 2016, 05:11:56 PM »
Hi,
you can share your whole project but without the Playmaker dll's

then when you open the project reinstall pm and it should work

or you can export the scene in a package but if there are things from your project that are needed (for example prefabs, custom action,...) you should include those when you export

What you also can do is make a video with your problem and show also all your states and actions that are involved.