Source image for buttons change when adding Timer image

After connecting my TimerImage the source image for my buttons change when I hit play. I cannot figure out why or how to stop this from happening.:

After adding the TimerImage:

Disconnecting the TimerImage puts it back to normal. Anyone else having this issue?

Hi,

Welcome to our community! :slight_smile:

Did you change a shader program? What texture do you use in the Image component? Make sure it is the button sprite, not something else.

If the issue persists, it might be caused by a bug. In that case, I would suggest to update Unity.


See also:

Iā€™m using the button sprites provided in the resources of this project. The same ones the instructor uses. I just updated Unity to the most recent recommended version, but Iā€™m having the same problem. You can see the source image in the scene is the ā€˜neon_square_blueā€™ but for some reason when I hit play it changes to ā€˜Quiz Master - Gameplay Overview 1.ā€™ And this only changed once I added the timerImage into the inspector.

Very odd. In your initial post, I read: ā€œDisconnecting the TimerImage puts it back to normal.ā€ What texture did you use for it?

And which version of Unity do you use? Maybe I could find your problem in the issue tracker.

If the issue persists in Unity 2022, please report a bug to Unity via Help > Report a bug (in the Unity Editor).

I started it on 2021.1.13 and then updated to 2021.3.5. Iā€™m using the ā€˜neon_round_orangeā€™ sprite provided in the project. I added it the same way the instructor does, as the TimerImage 2D sprite, then linking it up with the code onto the quiz canvas.

Are you sure about that? Here is what I see in your second screenshot:

image

Could you check if thatā€™s indeed your ā€œneon_round_orangeā€ sprite?

If itā€™s not and if the value of the field changed after you clicked the play button, please check whether your could might be overriding the value of this variable.

Yes, that source image is on the buttons. That is what changes when I hit play. The first picture shows the ā€˜neon_square_blueā€™ and when you hit play it changes to the ā€˜Quiz Master - Gameplay Overviewā€™ like you see in that second image. Though looking through everything again, I just realized on the Quiz Canvas inspector under the Button Colors, the Default Answer Sprite was set to the wrong image. Thatā€™s where it went wrong. Setting that back to the ā€˜neon_square_blueā€™ fixed the problem.

Good job on fixing the problem. :slight_smile:

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

Privacy & Terms