Author Topic: Checkmark not appearing in checkbox  (Read 3286 times)

Game Whiz

  • Guest
Checkmark not appearing in checkbox
« on: September 03, 2012, 10:56:16 AM »
Hi,

I have a checkbox in a panel that behaves just as expected. However if I uncheck the checkbox, deactivate the UI (SetActive or SetActiveRecursively to false) and activate the UI, the checkbox checkmark doesn't appear again when I try to check it. the state is changed, since if I check it (nothing appears), and then deactivate and activate the GUI again, it appears checked.

Bug or something I'm doing wrong?

Best regards,
Alex

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Checkmark not appearing in checkbox
« Reply #1 on: September 03, 2012, 03:27:59 PM »
When the UIButton / UIButtonColor is enabled, it records the current color as the "starting" color. Since you faded it out, the starting color has the alpha of 0.

Game Whiz

  • Guest
Re: Checkmark not appearing in checkbox
« Reply #2 on: September 03, 2012, 05:13:51 PM »
That's not it. The starting color does indeed have alpha=0 when I reactivate the gui, but it then tweens to alpha=1 when I click on the checkbox. The problem is that the checkmark isn't appearing even with alpha=1. If I deactivate and activate the checkmark in the editor during runtime, it then correctly appears.

Game Whiz

  • Guest
Re: Checkmark not appearing in checkbox
« Reply #3 on: September 03, 2012, 05:39:33 PM »
The problem was that the panel in which the checkbox was, was marked as static. I had clicked to clear the static checkmark, but I failed to notice that under Unity 4.0 the static field in the panel isn't clickable (and the panel continued as static). It's a Unity bug that you probably should report. A quick fix is to get rid of the GUILayout.Width() in the UIPanelInspector.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Checkmark not appearing in checkbox
« Reply #4 on: September 04, 2012, 12:40:02 AM »
Yup, this bug has been reported to Unity as far as I know. Phil mentioned it before. It's a regression issue, so I hope they will fix it soon.