Download

How to: Simple Camera Zoom w/ Mouse Wheel

@tahmidk15

Hey tahmidk15. I’m sure you already figured it out, but this’ll definitely work work ortho.

Instead of setting the length of the “Spring Arm” the camera is attached to, you set the “Ortho Width” property of the “camera” directly.

Yeah i figured that out with raytrace and delta location of mouse/touch on the surface, FYI your method didn’t worked orthographic camera. Changing arm length with orthographic camera doesn’t change anything.

I had been following this post in order to make my first blue print, Its the same camera that CaptanMigraine did, I also added a lock to the angle of the camera, and tried to add the camera arm socket offset (Z) capable to be increased and decreased when you hold the right and left bttons of the mouse It seems to work but it has a bug when you click the mouse to fast, since im new in BluePrints I have no idea of what could be wrong, so I hope someone can give me an advice

bp1.jpg

b70d04002cfb8a6f72849b34b8df77b6c7b4feb9.jpeg

0cebe5c9fd2fc7ff182b4182a43753999e4f0406.png

pd: sorry if some nodes are in spanish, the true is that for me would be easier to have them in english but I dont know how to change the language yet

I stumbled upon this post, because I was looking for help how to zoom with axis mappings. In the end I found my own solution and just wanted to share it.

Just use for an axis mapping “Mouse Wheel Axis” as input and use a scale of -1.0.
c4e48f766ecc2d9bdd2114156eed0b02e650e4b2.png

For ThirdPerson

Mouse Wheel Axis (and other asix for that matter) return one of these three values:

  • 1.0
  • 0.0
  • -1.0

Assuming we are working with variables we can just do this simple calculation to get rid of writing the same code twice and keep ourselves DRY:
newBoomArmLength = zoomSensitivity * axisValue + currentBoomArmLength
This is so that we don’t get 0.0 but rather the currentBoomArmLength when we get 0.0 as an axis-value.

If you don’t want any smoothing you can of course do away with the Event Tick code

This is the blueprint code: