Camera zoom. Am I an idiot? #19014
-
Hello, I am trying to figure out how to zoom the camera in and out. After failing to do this multiple times I am at a loss for words. I have no idea why such a simple concept in other game engines is so confusing in bevy. Does anyone have a working solution? I have the following, very basic, camera setup: I tried some stuff with the OrthographicProjection but it all just seems so needlessly confusing to do such a simple stuff as zooming in plus it did not even work. If somebody has a working solution, please help me with this as I am new to both bevy and rust. :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You can mutate the camera's projection to zoom in and out. Take a look at https://bevy-cheatbook.github.io/graphics/camera.html#zooming-the-camera |
Beta Was this translation helpful? Give feedback.
Hi, thank you for your reply.
Unfortunately the bevy cheat book is quite outdated and the syntax has changed, but your answer put me on the right track and I managed to put together some well-enough working code. Now there is still some goofiness happening (if you zoom in too much, you start zooming out instead of in), but overall I am happy with the results. For anyone searching how to zoom in bevy 0.16 here is my amateurish attempt.