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