0
\$\begingroup\$

I finished my game and it runs fine inside Unity. I exported it to WebGL and ran it there but the main menu background does not show. It looks the background color and is pretty annoying. Here are some snapshots:

enter image description here

It's supposed to look like this. It looks like this when I run in Unity.

But when I export the game, here is what I see:

enter image description here

Anyone know where should I look to fix this? Here are my player settings:

enter image description here

enter image description here

\$\endgroup\$
3
  • \$\begingroup\$ It looks like you forgot to show us how the background object is configured. Is it a UI image? A texured quad? A sprite renderer? etc... \$\endgroup\$ Commented Feb 14, 2021 at 12:14
  • \$\begingroup\$ I changed it to an Image and now it is working fine. Seems I have to use Image component to show something inside the canvas. \$\endgroup\$ Commented Feb 14, 2021 at 12:33
  • \$\begingroup\$ Want to share your solution as an answer below? \$\endgroup\$ Commented Feb 14, 2021 at 12:34

1 Answer 1

0
\$\begingroup\$

I added an Image component to the GameObject that holds the sprite. Then I had to make that default sprite object transparent so that it wouldn't interfere with the actual sprite I wanted to show.

\$\endgroup\$
2
  • \$\begingroup\$ Why not delete the sprite renderer component and just use an Image component alone if you're intending to display this with the UI system? \$\endgroup\$ Commented Feb 14, 2021 at 12:47
  • \$\begingroup\$ Don't forget to mark this answer "Accepted" if it worked for you. \$\endgroup\$ Commented Mar 16, 2021 at 13:20

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.