Unity 2D - Camera isn't where it's supposed to be - unity3d

In Unity 2D, I am working on a game that uses a square shaped camera that hovers over a tilemap (Zelda NES style). In the camera preview in the game view, it shows what it's supposed to:
But when I switch to the game view, this is what it shows:
Here are my camera settings in case it helps.
Does anybody know why this is happening and how I can fix it?

I finally figured out how to fix it. All I needed to do was set "Depth" on the camera settings to 0 (it was at -1 before).

You scene must have multiple cameras and one of those camera's depth would be > -1 hence its showing that camera and not your maincamera, if you just have one camera the depth does not matter

Related

Unity2D Visual Problems

I created a turret that auto-shoots bullets , fairly simple and not complex, but I have some visual problems. Like in the Editor while Play mode is active the bullet spawn and is visible , but when I go in that place in play mode the bullet is invisible (the bullet applies the damage to the Player but it is not here).
Some footage of the problem: https://gyazo.com/899f4c60f7d3e0fc943c104bba7c2831
There are 2 possible answers:
set the canvas to Screen Space - Camera, and set the Render Camera to Main Camera.
linke to the full artical
fix the possition of the srite and the canvas
link to the full artical
Thank you for all the help!
IT WORKED!
I find out that , my turret Z's was like -68 and the camera was like -10, and i randomly entered the 3D View of my scene and i noticed that my Turret was like 10 kilometers away from the actual position from the editor!

Why does the scene camera change position and rotation on play

Win 10 Pro, Unity 2019.2.17f1
This issue occurs on occasion, randomly. It has happened with multiple different scenes on this machine.
In this instance, I have a scene that is completely empty except for the default Main Camera and Directional Light. I have not added any scripts to the scene. In the inspector the camera is at position 0, 10, 0 with rotation 90, 0, 0 by default. Once I hit play, the camera instantly jumps to a seemingly random position and rotation. If I delete the main camera and make a new camera game object, the same thing happens to it. Please see this screen recording demonstrating the problem:
https://youtu.be/JMl2arXzeCo
I'm thinking it might have something to do with the fact that I have SteamVR running on my machine. Does anyone know what causes this, and where I might be able to find a setting to toggle this behavior? Thank you
In the console you get
OpenVR Initilaized
You seem to have Virtual Reality Support enabled in the ProjectSettings -> Player -> XR Settings thus the camera position and orientation is controlled by a virtual reality device.
From the orientation I would guess that it lies around somewhere ^^
Simply disabling this should fix your issues.
To add to derHugo's answer: to stop the camera from following the VR device without disabling VR support, set the Camera component's Target Eye property to None (Main Display).

Oculus Unity VR - Separate UI Camera Not Working

I have a VR project for which I am trying to render a canvas to be "always on top" of everything using a separate UI camera as noted here.
I made my UICamera object a child of the main camera - which is the centerEyeAnchor object in the OVRCameraRig.
And I set the culling mask for my UICamera to only show its layer and removed that layer from the main camera (CenterEyeAnchor).
But in fact the perspective is weird and it seems like the UICamera is offset a little bit but its transform is zero'd out in the inspector, so I don't why it's displaying so weird.
If I set the culling mask to "Everything" for both cameras it's still offset a little.
In general you don't need the UI camera to be a child of CenterEyeAnchor. Move it out to to the top level and zero out the coordinates. The Oculus rig might be doing some magic with IPD or something else and it screws up the pixel-perfectness of UI.

Sprites quality is very bad in Game window in Unity

I have created a 2D project. The images I used for sprites are all with high resolution. However I do not know what settings I have changed today, the sprites in game window started look terrible when I tested the game(good quality in scene window). And this happens to all of the projects I created earlier. But when I build the exe file to play, the graphics look all good with original quality. Could anyone tell me how to fix this issue?
Scale back the game view to 1x and change the size of your camera instead or set your sprites to their original size if they have been resized
If you have a Retina screen, make sure you uncheck the following checkbox.
Watch this screencast
For 2D game also make sure Projection property in Camera component is set to Orthographic

Unity Particle System cannot appear in game scene

I have problems with my unity particle system. It is appearing in the scene but it does not appear in the game scene after it is being played. What do you think the problem lies in?
1.ParticleSystem is not loop, not enable or not play...
2.Your particles are too small.
3.Particles are not in the camera's view.
4.If you are using Unity's 2D tool, maybe sprite's sorting order is above your particle. <- Change ParticleSystem's sortingLayerName and sortingOrder.
There's also a bug where the particle's origin (usually the centre) is well outside the camera's frustum they can be incorrectly culled. I found this with giant sunbeams.
I had a similar issue. The problem for me ended up being related to the Renderer Module's "Render Alignment" being set to "World". Pair this with -90 rotation on X and it made my particles disappear (2D game with an orthographic camera probably didn't help). Switching Render Alignment to "Facing" fixed my issue.