How to: Simple Camera Zoom w/ Mouse Wheel

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 simple calculation to get rid of writing the same code twice and keep ourselves DRY:
newBoomArmLength = zoomSensitivity * axisValue + currentBoomArmLength
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

is the blueprint code:

1 Like