Cannot use Camera component in WebGL

Hi, I’ve run in to a particularly weird issue that only happens when I switch the Unity build to WebGL.
My camera component was not being applied to the game view; whenever I hit run, it just pretends there’s no camera, and just shows an angle from underneath the floor (I think it’s 0,0,0). Problem is, when I searched how to assign the camera to the game view, it shows a tab not only in the game view window, but also something I can select on the camera component itself.

Here’s the game tab in PC build, with the “Display 2” tab I need:
8823850--1201243--upload_2023-2-21_10-20-56.png
here’s the same tab, but switched platform to WebGL. The drop down button disappears!
8823850--1201252--upload_2023-2-21_10-22-22.png

A similar thing happens to the camera component itself:
PC build:
8823850--1201246--upload_2023-2-21_10-21-31.png
WebGL build (Target Display is gone):
8823850--1201255--upload_2023-2-21_10-23-38.png

I’m assuming there’s something simple that I’m doing wrong out of ignorance. I couldn’t find anything in the Unity manual saying cameras are handled differently.

2 Likes

Today I encountered the same problem.
Furthermore, if I use the WebGL platform, my application doesn’t work and therefore I can’t send it to Unity Play.
However, if I use the PC platform, the application works and the Tab Display appears in the Game View, and also the Target Display property in the camera Inspector.

WebGL has only 1 display target, the HTML canvas element.
Try to switch the target display to Display 1 and then build.

And report bug. If Unity disable/locks the option to switch target display in WebGL and show the camera in editor as if it draws to display 1, it should draw to the one target on runtime as well

Webcam works on editor but not working on webgl. I tried to alter the settings mentioned above. Camera light is on but screen shows black. Although it works on editor