I just finished my 1st tutorial on Camera Zones, Camera target, Changing targets and managing multiple zones.
It’s a 4 part “series” and this is a my first tutorial so please constructive criticism is more then welcome.
I have 3 videos out of 4 that are ready 2 of them are already uploaded and the 3rd one is uploading as we speak. The 4th video will probably be ready tomorrow but with the first 3, you will be able to make the camera zone work. The 4 video will show you how to change targets on the fly. (ex. following player, then following projectile or showing a special area, then coming back to player.
What will you learn:
Setting up your camera
Setting your camera zones
Setting up your triggers to activate those zones
Setting up the target that the camera needs to follow
Setting up a logic to change target on the fly (ex.: from the player to a projectile or specific area of your map and then back to your player.)
Setting your camera in your scene, referencing it in other blueprints, calculating the coordinates of your camera zone and assigning a target.
how to set multiple zones with triggers and how to know when they are activated.
how to handle the camera movement.
Why I did this?
My game is a sidescroller and I needed the camera to stay within a certain boundary depending on where I was in my level. Also, in certain circumstances, I will need for the camera to follow another target then my player. With the spring arm and camera attached to the player, It complicated things a bit especially when it came to not showing certain parts of my map, with collisions, etc. So by settings my camera like this, I feel I have more control over it and it stays where I want.
So hope this help some of you out there and happy game deving everyone
Thanks for pointing it out… I forgot about that little but very important part.
First, none of the code for the camera blueprint and trigger detection in the player’s blueprint has changed.
What you do have to look for, are:
The configuration settings in the world outliner and the blueprint of the camera (Class settings).
The nodes that I’ve added (Set View Target with Blend) to the level blueprint (not your menu scenes, but your game scenes where you will be using this camera) (It’s accessible by the menu just above the viewport).
The nodes that I’ve added (Set View Target with Blend) in the Character’s blueprint.
In my game, however, the player can zoom the camera in and out (to the zoom roof and zoom floor). Right now I have it setup to switch camera zones when halfway between, however I would rather change it to a smooth transition between the two zones, as shown in the image below. Any ideas on how to accomplish this?
Additionally, I would like to make it so that based on what camera zone it is, it knows which two zones to pull the values from, that way I can have multiple zones with an upper and lower zone. Hence, the Camera Zone 1.1 and 1.2 in the image. The triggers also need to know how to switch to the exact clamp value between the two zones, based on how close to the zoom roof they are.
When changing zones, it sets the Zone Min and Zone Max. Currently, I simply have it change the camera zone from 1.1 to 1.2 using the on camera trigger event.
So maybe I should have it get the zone min and max for the zoomed out zone and the zoomed in zone at the same time, then treat those as a zone zoom roof? Then I set the location to the location of self but clamped with that value.
Do you use lerp when zooming which allows a more smoothing transition?
Also, there are some variables that need to be adjusted since your camera is closer. Just on the top of my head, you have the smoothing (since you are closer when zoomed in), margins (they might also be different because of how close you are) and CameraHalfWidth.
What I suggest, is that you zoom out completly, figure out all of the variables values. Then, zoom in completly and figure out those variables’ values. Once you have those, lerp between them while zooming. It should allow you to have a more smoothing transition. But of course, this is a guest since I don’t use zooming in the my game.
Okay, Let me re-explain my problem. I don’t need anything except a new function that gets a point in between two camera zone’s min and max. I’m using the advanced turn based tile toolkit, and I do not use the smoothing or margin.
I have made it so that every time it gets the zone min and max, it also sets the zone min and max for the next zone in the zone array. I will always have it setup where the bottom zone is the next zone in the array, and I never actually switch to that zone. I have a roof zone min and max and a floor zone min and max. I will set the zone min and max to use when clamping with this new function, after.
In short, based on the two orange dots and the blue dot, I need to find the Green dot.
Edit: So, Looking back at the toolkit, it does something similar, but not quite.
I need to get the distance between the two vectors, then multiply it by the timeline float value and that is what I will set Zone Min and Zone max to…
Any chance you could post the changes you made to the blueprints? I tried downloading the new project but its unavailable. Im using 4.20 so still not sure if its compatible, but would like to give it a go. This sort of camera control is exactly what I need.