Camera zooming when hitting an area2d

Godot Version

4.2.2

Question

Hi! My name is Cos and I’m working on my first project. I’m new to everything, so I apologise in advance if this is a really silly question.

I’m working on a 2d game in a similar style to Oxenfree (though nowhere near the size or scope or craft at all). My plan right now is to start my game in a small location and then exit that to a much larger one.

I’m starting with the camera2d zoomed in and the idea is that I walk through an area2d after which the camera zooms out to look at the whole area. I’ve looked online and can’t find a way to do this. Is it a case of writing code to make this happen?

So, I need to: go through an area2d and have the camera zoom out, and also change the camera’s limits.

Again, hello, hi, if you need me to clarify or explain stuff better, let me know and I’ll try. And thanks in advance, it’s all new to me right now and it’s a little nerve wracking!

Cos

area 2d should send signal to camera (or other node if this is more convenient)
reciver’s code:

func : #it will automatically appear
    zoom = Vector2(0.5, 0.5) #(how much zoom) or get_node if not in camera script
1 Like

thank you so much, this is exactly what i was after.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.