Move camera up when W is pressed

Hello everybody! I am new to BP in UE4, I am planing to make my first game using UE4. I have set up the basic movement and jumping. The plan is to make camera movement when W is pressed, like in old games you press W camera slightly goes up and you can see what happens upstairs and when you release W camera comes back to location. I am planing to use spring arm. Any ideas how can I made that? Any help will be appreciated

This problem/task can be split into two tasks:

  • receive input from keyboard (pressing W)
  • move camera up/down

For first ie trigger changes when W is pressed:

i do not know if you use old (depreciated input) or new one

  • for old one add W as axis input in project input settings. set it to +1 value
  • in your pawn or character blueprint on event tick read that value of W input axis
    Now you should have first half done

For second part (moving camera)

You can move camera up/down, or rotate it (up down slightly)
To do it use MapInRange node. As input you have 0.0 to 1.0, as output you have whatever you need.
Then add that output value to camera Z location, or to angle of camera.

1 Like

I’m not sure if this method is correct, but it works and this is exactly what i want.

Great you have it done. It is correct method, you can edit speed and how fast it starts and slows down.

1 Like

Thank you, pointed me in the right direction!

1 Like