Link to the Past top-down camera?

Hi! I’d prefer doing this in Blueprint, but C++ is alright with me too. Since I can only place this in one section, I picked BP :stuck_out_tongue:

So I’m creating a 2D, top down game after spending some time practicing my C++ and Blueprints (clearly not enough hahaha XD). I really like how the camera works in Link to The Past, and I’d like to replicate that to some extent.

This type of camera is used in many top-down games, I just thought it’d be easier for most people to relate with LTTP.

At first glance, the camera is rather simple. It’s your typical top-down camera that just follows the player around. I have absolutely no problem getting there. However, the camera is a bit more complex than that, because whenever the player goes to, or is nearing another “room”, the camera sort of stops chasing the player until he enters that area, and then moves towards where the player is.

How can I accomplish this?

Around 2:50

you can make a CameraVolume, which is just an actor with a box component and a vector called boxExtent. then you need to set up an interface function called SetCameraBounds, and have your character implement that interface.

on begin or end Overlap on the camera volume, it should tell the actor to call the SetCameraBounds function, which will get the cameraVolume its currently overlapping, and use its location and size to do some math that constrains the camera to that volume.

its easier to explain with an image, so here is how the camera volume and character blueprint should look:

as long as you have a camera volume for each room in your game, the transitions between each room should work automatically.

Could you do a video tutorial on the above code. Like Record it while you are in the unreal engine editor. that would be very helpful. thank you so much