[Solved] How to zoom in camera smoothly

I only want to use change camera zoom event and Time delta () to zoom out until the camera value is 0.5. But I am trying for 1 day I saw many tutorial in youtube but still I failed to do that.Any help will be thankful. To help to understand,
I want when my player is in distance with an apple of 200 pixel camera will zoom out to help to see the tree.But after I eat the apple it will zoom in to normal size.I know how to do that but it zoom in and out so fast. I want to make the zoom smooth.

a timer + a variable to control the camera’s zoom parameter isn’t work?

I don’t know how to make zoom in or out by the timer.Can you help me?

I think you are done with the timer part, just the default zoom speed is too fast for you. but if you start from the beginning, I recommend to your attention this complete video tutorial from gamevisualz Full Tutoiral How To Make interactive camera zoom Gdevelop 5 - YouTube. this is a complete guide to how to do the camera zoom, and he show how to adjust zoom speed.

1 Like

I saw that tutorial. It was not very helpful for me.
I want when my player is in distance with an apple of 200 pixel My camera will zoom out to view the tree and if I eat the apple it zoom in again.

Please help me:sob: this is the demo https://we.tl/t-ofPvD8Qc0K

but you are see how he slow up or down the zoom speed. this is what you want. now implement his solution to your code. change the conditions and actions to fit your needs.

:sob: I tryed for 4 hour after your reply…still Its not working :sob::sob::sob: i AM so sorry please help

1 Like

I have a tutorial that could help.

2 Likes

In the tutorial above you will see how to make a smooth camera zoom. Please let me know If it was helpful

1 Like

Use lerp() function

lerp will interpolate values in a interval of time with TimeDelta()

lerp(valueStart, valueEnd, TimeDelta())

take a look on “bouncing-ball-and-rope” example

2 Likes

I am stuck :sob: because I don’t know programing or I am weak in math .
I faied to zoom out…Files are here…Please help me to zoom out .https://we.tl/t-ofPvD8Qc0K

1 Like

Thanks your tutorial was helpful.

1 Like

Ok Gyes I have solved that problem by help of @Venom …here is the events that I was asking [Solved] Mouse wheel smooth zoom problem


this creates a smooth zoom in to the center, change the zoom from add to subtract and the number from 0.01 to 0.001 to zoom out

to set a limit use this