using camera zoom causes my player to move faster in the y direction

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Ben Nicholl

I am creating a soccer game. For the soccer game. I have a camera nested inside an area2d node, which is my soccer ball. The camera2d zoom parameters for X is 1 and for y, 0.4. I’m doing this to make the width of the soccer field seem smaller, as my phone will be played in landscape mode. Zooming in this manner causes my player to move faster in the Y direction. I’m assuming Godot is stretching the Y direction frames when zooming in, which makes the player move faster in that respective direction. Is there an easy way to remedy this?

:bust_in_silhouette: Reply From: jtarallo

Hi Ben.
Your way of “making the soccer field seem smaller” is a bad approach. The player is not moving faster in the Y direction. It looks like it because you have compressed the height of the field and the player has to “move less” for you to notice the movement.

What you should do is just scale your scene and soccer field correctly taking up all the space of the screen and not use camera zoom for this purpose.

Not sure how to scale this for what I want. The game will be played on mobile devices, where the screen device will be tilted sideways. Up and down will go towards the goals, while left and right will go towards their respective side lines. I was under the impression that I would need to 1024X574 project in the settings, than zoom in on the Y direction to make the width(sideline to sideline seem smaller).

Ben Nicholl | 2020-06-10 16:57

Honesty without knowing anything about your game, its mechanics and how you want the player to see and feel it, it is difficult to give you a pointer or directions, much less give you pixel width and height dimensions.

For example, if your player has to click on the screen to determine movement, the approach would be one way, and if the players move on their own and you’d have to click to shoot the ball, it’d be something else I suppose. Possibilities are endless and you have to work out what bests suits your needs, but I can assure you zooming the camera with different values on different axis will not be the way to go about any of those.

jtarallo | 2020-06-10 17:25