Correct Answer's buttonsprite bug

Hi,
After finishing this lecture yesterday without issue I turned on Unity today and suddenly encoutered a strange bug where the correct answer’s buttonsprite is not displaying correctly (see attached image).

I experimented with different questions and it’s always specifically the correct answer’s buttonsize that shrinks like in the image (whether it’s the 1st, 2nd, 3rd or 4th button).

I still (vaguely) see the sides turn to orange when I click an answer so it’s still detecting the sprites, but I can’t figure out why the size changes like it does on the picture…
As far as I can tell this isn’t done in the code, I also went back to the button lay-out lecture to double check my AnswerButtonGroup settings in the inspector, but I can’t spot any difference…

Any ideas why this is happening?

Update: The issue has disappeared just as randomly as it appeared (for now).
I moved on to the list section and afterwards I still had the bug though with slightly changed behaviour, it was no longer strictly bound to the correct answer,…
Anyway after a while it stopped happening alltogether, I have no idea why.

1 Like

Hi Davy,

I assume you are using a LayoutGroup component? If so, make the box in which you display your answer buttons larger. If that didn’t work try to use a LayoutElement component on each button and define a “Preferred Height” or “Min Height” there.

Layout Element | Unity UI | 1.0.0 (on each answer buttons)
Content Size Fitter | Unity UI | 1.0.0 (on the same game object as your LayoutGroup)

I hope this helped. :slight_smile:


See also:

1 Like

Thanks Nina,

I will definately refer to this should this or a similar problem return.
For now, everything’s working correctly again.

How and why this bug (dis)appeared is still a complete mystery but I’m glad it’s gone. :smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms