Center camera on an object issue

Hello!

I’ve used the action to center the camera on my player but the prob is that it’s centered on the x and y axis which makes the player too high on the screen which makes the screen equally half full of sky and ground.
Is there way to adjust this so he’s centered on the x axis, but scooted lower on the Y?

Hi,

you can always reduce (-) or add (+) pixels to a specific position. For example player.Y() - 20 or you can use the “enforce camera boundaries”- action.

1 Like

Enforce camera boundaries! I’ve yet To see this

Okay so I’m in that action, but could you give me a specific example of how that would be written?

First you center your camera on your player as you already did. Then you add the enforce camera boundaries action. There you just have to enter the x- and y-values that set the limits for your camera. These values are usually the same as the size of your level.

Let’s say you have a resolution of 800 x 600 and your level is three screens wide and two screens high, you would enter it like: Left bound X Position = 0, Top bound Y Position = 0, Right bound X position = 2400, Right bound Y position = 1200. In this case the camera is centered on the player but it would not go below 1200 on the y-axis.

If you used the ‘Center the camera on an object’ action your player should be in the middle of the screen. What is visible on the screen depends on the position of your player and the size of your viewport.

1 Like