How can I lock a component to follow the mouse on the Z-axis?

Hi all, I’m currently making a 2.5D sidescroller where a flashlight is involved in one of the levels. At the minute, I have a flashlight following the mouse in a 3D space when I want it to follow my mouse on the Z-Axis so the player can move the flashlight up and down rather than along the floor.


At the minute, this is what I have set up. Thanks in advance for everyone’s help!

Have a look here, there’s a bunch of examples: