Download

How to: Simple Camera Zoom w/ Mouse Wheel

I’m new to all this and it took me about 3 hours to actually figure out how to go about getting my camera to zoom in/out. So to save all the other newbies out there the trouble here is the blueprint prototype i set up, hope it helps :slight_smile:

http://s4.postimg.org/wcybtepdp/Mouse_Zoom.jpg

To zoom out you would just add to the Target Arm Length

Nice. Here is an alternate way.

By the way…you can get smooth transitions using Event Tick + FInterpTo node.

YAWTZTC (Yet Another Way To Zoom The Camera)

This setup works with several cameras, just make sure you have the correct one assigned to current Camera. The Zoom inputs are mapped to actions that use MouseWheel and the factors are 1.1 for zoom out and 0.9 for zoom in.

EDIT: Forgot to mention I keep my view target at 0,0,0.

I was able to get mouse clicking functionality working but scrollwheel isn’t working for me.
MouseScroll Up/Down isn’t registering. Even added a print string just to make sure it wasn’t my blueprint setup. Am I forgetting to check some box to activate Mouse Scroll Functionality?

i see yesterday that tut
https://www.youtube.com/watch?v=Dxt00BjRUtY&index=34&list=PLedhcphOZyVw8AC2O4CIKnYTzkfTc8Pfz

Edit > Project Settings > Engine > Input, you have 2 Action Mappings, one called ZoomIn with Mouse Wheel Up and one called ZoomOut with Mouse Wheel Down? If you need to add them, don’t forget to click the “Set As Default” button.

yeah I only added those just to see if for some reason I needed to add it to work. So after further tests, the inputs that I’m pressing are only being done when I place them in the PlayerController blueprint I’m using.

So when I try to execute a mouse click, scroll up, scroll down, etc., they are only executed if I put them in the player controller. This is a bit of problem since I don’t know how to gain access to the camera of the character I’m controlling with the spring arm from PlayerController blueprint.

Can you elaborate on how to set that up?

How do we do pinch to zoom in/out?

Having the same problem, could anyone elaborate on this?

Bump! Anyone?

Here’s what I have so far, I just need smoothing -

Here you go guys. This is using a Camera Boom. We set the fact the player wants to change the zoom level to a variable “GoalArmLength” and then on Event Tick use FinterpTo to actually set the length nice a smooth. This is not clean but it works.

Hello, I cleaned up your BP a bit and worked with a clamp instead of < and >, much neater in my opinion :wink:
Here’s a screenshot, much thanks to you for the idea tho! Might update it with a nicer curve (like the further you zoom in the bigger the sensitivity and vice versa)

attractive approach, I’d like to add an important factor to it… when you zoom in too close you will be actually looking at the character (as*) haha … !! so we can make a good use of the camera arm socket offset (Z) to be increased and decreased side by side with the arm length using the same methods here before… that will make the camera diagonally zoom to the head position which is natural and right instead of … lol :smiley:

Make a couple of sockets on the character mesh to hold the cameras positions of where you want it when it is zoomed in and out all the way. Have the camera, when it is zooming in and out, move to those positions. That way you can move the zoomed-in camera’s socket to their arm, their head or even their …well, you get the point.

I improved upon the camera scroll blueprint.

Explanation: The camera will now slow down when it reaches its maximum or minimum height, resulting in an even smoother camera movement. Also, I added a check to see if the “Goal Arm Length” needs to be recalculated. This results in the calculation only occurring when it’s needed.

https://dl.dropboxusercontent.com/u/1997866/PublicForForumsWebsitesDONOTDELETE/misc_pics/2016-04-25%20Smooth%20Camera%20Scroll%20Blueprint/2016-04-25_Smooth_Camera_Scroll_Blueprint_FULL.png

Hi guys could you please explain to me how the “target Arm Length” was created, is it just a variable created? how do i get it to connect with the Spring Arm? I am currently setting up a orbit / zoom in/out for my “game” and it’s surprising tricky for what you think of simple gestures! any help much appreciated!

Anyone know how to implement zoom under mouse cursor or zoom under a screen position ? like when zoom in object under the mouse will stay still like Clash of Clan or Boom Beach style camera zoom.

You need:
Location of mouse in world space. (MWSL)
Pawn location. (PAWN)
Spring Arm; Arm length (AL)
Spring Arm; Starting Arm length (SAL)

Set pawn location, when you set new spring arm arm length, to L= (((MWSL-PAWN)/SAL)*(SAL-AL))+PAWN

thanks but is this work on orthographic camera ?