- Home /
Camera Z Position moves to Zero, when a Rigidbody2D is added to a gameobject
I am a Unity beginner and also do not have a lot of stuff in my game, so this maybe is a "dumb" issue.
I am working on a 2D game, I don't have a lot yet. I currently have some Sprites in my Scene - two of them have Colliders2D, but the rest does not. No Object has a Rigidbody. All of these Sprites are set to Z Position 0. My Camera is on Z Position -2 and normally works just fine.
When I now add a Rigidbody2D to any of my objects, the camera suddenly moves to Z Position 0, as soon as I start the game, resulting in not seeing anything.
I can work around this issue by putting every object on Z Position 1, instead of 0, but before I do all this:
Why does the camera do this? I feel like, I may made some dumb mistake, because it is such a weird error. Again, if there is no Rigidbody2D attached to any object in the scene the camera stays on Z Position -2 after starting the game and does, what it should do.
Why does it only move when there is a Rigidbody in the scene and why to Z Position zero?
Hope you can help me!