I’m not sure how much I should worry about this, but my camera preview is not showing what Rick’s does. Even though the scene is fine, the preview shows almost nothing. I say “almost”, because for some reason it does show the left and right trees. The game mode also looks fine … but it doesn’t show the test sprite used to check coordinates. I played around with options and sort orders, but I still can’t get the preview to show my real canvas and background. I’m including various relevant screen shots.
Hi,
How does your game look in the game window? Is the background missing there, too?
Please assign the Main Camera game object to the Event Camera field in the Canvas component.
Nina,
How does your game look in the game window? Is the background missing there, too?
In the game window it looks fine. I included the game window in one of the post attachments if you want to check that out.
Please assign the Main Camera game object to the Event Camera field in the Canvas component.
Tried that now, but didn’t help.
The good news is that I have some new findings that might help you, even thought they still confuse me …
I thought it was really weird that the camera worked for the trees, and not the background (I included screenshots of both so you can see the inspector). I looked for differences, and the main one is that the background is created with an Image component, while the the trees were just dropped in the canvas, and get created with a Sprint Renderer. Obviously that wasn’t a personal decision, but just something I followed along in the chapter.
So …
I tried adding the same background image by dropping in the canvas (like Chris does with the tree), and sue enough that version becomes visible in the preview camera.
But I see that more as a clue than a solution, since I assume there are specific reasons why Chris wanted the background as an UI image component. I also don’t like things I can’t explain. But in any case, hopefully that hint will make sense to you or someone else.
Oh, one more “clue” is that the white dot that Chris uses to test things out doesn’t show up in the preview for me either. I added that Inspector Screen Shot here, since I didn’t have it in the first post.
Thanks in advance.
I think you are right. Actually, the canvas and its UI-elements are, unlike SpriteRenderer and other Renderer components, not seen by any camera. It might be that the canvas despite being set to “World Space” does not appear in the camera preview because it is still not seen by the camera.
As long as your game looks as desired in the game window, I would not worry too much about this.
Ok … I’ll proceed on faith for now. But the strange thing is Rick shows the preview in his video, and it seems to be showing correctly. AND I double-checked (rewinding the videos) that his objects (Canvas, background, trees, etc) are created the same way mine are. So it’s still hard to understand why they work for him and not me.
Thanks for trying.
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.