Question about camera positioning (SOLVED)

1-I have a collection that contains my main character.
2- I added a camera object to that collection and made it a child of the character object.
3- The camera object’s position is at (0,0,0) which is not lower left but at the center of the scene.

The problem now is that when I run the game the camera is positioned much higher than the rest of the scene. I tried moving it to the lower-left of the character object but it’s still not right.

How can I position the camera properly?

You need to offset the camera game object by half the width and height of the screen if you want to center on the player.

Check this example of top-down movement with a centered camera:

1 Like

I don’t want it centered, I want it to appear as if there was no camra in the scene. right now it shows above the objects in the scene ( as I mentioned previously), do I have to keep moving it manually until I get the desired position?

So the camera should be at 0,0 but you have it as a child to the player? And I assume the player is moving? I’m not really sure I understand what you wish to achieve.

I was trying to follow these instructions from another thread:

The easiest way is probably this:

1-Create a game object containing the camera component. Make sure that the camera component acquires camera focus.
2-Place the game object at origo. The position of this game object now controls rendering and position 0,0 matches the lower left corner of the camera view.
3-Child the camera game object under the player character (just drag and drop in the collection). The camera game object is now transformed as a child to the character in the scene-graph and will follow its moves.
4-Offset the camera as you like. Remember that the camera game object position is lower left corner of view.

I may have understood the lower left corner bit, I thought it said to move the camera itself to the lower left corner.
Anyhow, I just kept manually moving the camera until I got the desired result.

No, it means that wherever the camera component is placed will be the lower left corner of the screen in the game (with the default render script). So if you have a character with a camera childed to it and you want the character to appear in the center of the screen for example, you need to offset the camera half a screen to the left and half a screen down.

2 Likes